tribler.core.database.augmenter
Attributes
logging {50: CRITICAL/FATAL, 40: ERROR, 30: WARNING/WARN, 20: INFO, 10: DEBUG, 0: NOTSET} |
Classes
This class is responsible for "slow" search. It creates its own language, based on torrent titles, to augment |
Module Contents
- tribler.core.database.augmenter.logger
- tribler.core.database.augmenter.LOG_LEVELS
logging {50: CRITICAL/FATAL, 40: ERROR, 30: WARNING/WARN, 20: INFO, 10: DEBUG, 0: NOTSET} SentencePieceTrainer { 3: FATAL, 2: ERROR, 1: WARNING, 0: INFO }
- class tribler.core.database.augmenter.AugmentedSearch(config: tribler.tribler_config.TriblerConfigManager, notifier: tribler.core.notifier.Notifier, task_manager: ipv8.taskmanager.TaskManager)
This class is responsible for “slow” search. It creates its own language, based on torrent titles, to augment user queries.
- config
- max_title_length = 4192
- initialized = False
- write_completed: asyncio.Future[None]
- task_manager
- model_file
- title_cache_file
- processor: sentencepiece.SentencePieceProcessor
- consume_torrent_metadata(metadata: dict) None
We found a new torrent title. Put it in the cache and start learning when we have sufficient data.
- write(trained_model: bytes) None
SentencePiece really wants to write to disk and then load it again. We need to be sure that new input was actually written to disk before reading it, or we lose data.
- async study() None
Study our most recent torrent titles and add them to the top tokens that we have already found in the past.