nlp_architect.models.absa package
Subpackages
- nlp_architect.models.absa.inference package
- nlp_architect.models.absa.train package
- Submodules
- nlp_architect.models.absa.train.acquire_terms module
- nlp_architect.models.absa.train.data_types module
- nlp_architect.models.absa.train.generate_lexicons module
- nlp_architect.models.absa.train.rerank_terms module
- nlp_architect.models.absa.train.rules module
- nlp_architect.models.absa.train.train module
- Module contents
Submodules
nlp_architect.models.absa.utils module
-
nlp_architect.models.absa.utils.
load_opinion_lex
(file_name: Union[str, os.PathLike]) → dict[source] Read opinion lexicon from CSV file.
Returns: Dictionary of LexiconElements, each LexiconElement presents a row.
-
nlp_architect.models.absa.utils.
parse_dir
(parser, input_dir: Union[str, os.PathLike], out_dir: Union[str, os.PathLike] = None, show_tok=True, show_doc=True)[source] Parse a directory of raw text documents, one by one.
Parameters: - parser (SpacyBISTParser) –
- input_dir (str or PathLike) –
- out_dir (str or PathLike) – If specified, the output will also be written to this path.
- show_tok (bool, optional) – Specifies whether to include token text in output.
- show_doc (bool, optional) – Specifies whether to include document text in output.
Yields: CoreNLPDoc – the annotated document.
-
nlp_architect.models.absa.utils.
parse_docs
(parser, docs: Union[str, os.PathLike], out_dir: Union[str, os.PathLike] = None)[source]
-
nlp_architect.models.absa.utils.
parse_docs_bist
(parser, docs: Union[str, os.PathLike], out_dir: Union[str, os.PathLike] = None, show_tok=True, show_doc=True)[source] Parse raw documents in the form of text files in a directory or lines in a text file.
Parameters: - parser –
- docs (str or PathLike) –
- out_dir (str or PathLike) – If specified, the output will also be written to this path.
- show_tok (bool, optional) – Specifies whether to include token text in output.
- show_doc (bool, optional) – Specifies whether to include document text in output.
Returns: (list of CoreNLPDoc)
-
nlp_architect.models.absa.utils.
parse_txt
(parser: nlp_architect.pipelines.spacy_bist.SpacyBISTParser, txt_path: Union[str, os.PathLike], out_dir: Union[str, os.PathLike] = None, show_tok=True, show_doc=True)[source] Parse raw documents in the form of lines in a text file.
Parameters: - parser (SpacyBISTParser) –
- txt_path (str or PathLike) –
- out_dir (str or PathLike) – If specified, the output will also be written to this path.
- show_tok (bool, optional) – Specifies whether to include token text in output.
- show_doc (bool, optional) – Specifies whether to include document text in output.
Yields: CoreNLPDoc – the annotated document.