Predictor¶
main¶
-
nlper.predictor.__init__.main(text: str)¶ Executes the text prediction pipeline, obtaining the summarization
- Parameters
text (str) – Text to summarize
application¶
-
class
nlper.predictor.application.Application(text: str, config_path: str = 'resources/model_files/predict_config.yaml')¶ Text predict application which obtains text summarization. Starts by initializing objects with cleaning utils, json reader and vocabulary config.
- Parameters
text (str) – Text to summarize
config_path (str) – Path to yaml config file, by default loads example config
-
predict() → None¶ Calls model predict method and creates attention heatmap.
-
prepare_model() → None¶ Initializes and loads saved model for prediction.
If config file specifies
use_dummy_modelas True, the model is initialized with random weights.
-
prepare_text() → None¶ Prepares text for prediction.
-
prepare_vocab() → None¶ Prepares vocabulary by loading it from
vocab_pathspecified in yaml config file.Assigns parameters called
itosandstoiofVocabConfigclass.Sets text size to numbers of words in vocabulary
-
run() → None¶ Executes text prediction process.