# nlp_architect.models.absa package

## Subpackages

- nlp_architect.models.absa.inference package
  - Submodules
  - nlp_architect.models.absa.inference.data_types module
  - nlp_architect.models.absa.inference.inference module
  - Module contents
- 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

  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)

  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: nlp_architect.pipelines.spacy_bist.SpacyBISTParser, docs: Union[str, os.PathLike], out_dir: Union[str, os.PathLike] = None, show_tok=True, show_doc=True)

  Parse raw documents in the form of text files in a directory or lines in a text file.

  Parameters: | parser (SpacyBISTParser) – 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)

  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.

`nlp_architect.models.absa.utils.``read_generic_lex_from_file`(file_name: Union[str, os.PathLike])

  Read generic opinion lex for term acquisition.

  Parameters: | file_name (str or PathLike) – name of csv file

## Module contents