-
-

text module

-
-
-class text.PostprocessText(mydict: dict | None = None, use_csv: bool = False, csv_path: str | None = None, analyze_text: str = 'text_english')
-

Bases: object

-
-
-analyse_topic(return_topics: int = 3) tuple
-

Performs topic analysis using BERTopic.

-
-
Parameters:
-

return_topics (int, optional) – Number of topics to return. Defaults to 3.

-
-
Returns:
-

tuple – A tuple containing the topic model, topic dataframe, and most frequent topics.

-
-
-
- -
-
-get_text_df(analyze_text: str) list
-

Extracts text from the provided dataframe.

-
-
Parameters:
-

analyze_text (str) – Column name for the text field to analyze.

-
-
Returns:
-

list – A list of text extracted from the dataframe.

-
-
-
- -
-
-get_text_dict(analyze_text: str) list
-

Extracts text from the provided dictionary.

-
-
Parameters:
-

analyze_text (str) – Key for the text field to analyze.

-
-
Returns:
-

list – A list of text extracted from the dictionary.

-
-
-
- -
- -
-
-class text.TextAnalyzer(csv_path: str, column_key: str | None = None, csv_encoding: str = 'utf-8')
-

Bases: object

-

Used to get text from a csv and then run the TextDetector on it.

-
-
-read_csv() dict
-

Read the CSV file and return the dictionary with the text entries.

-
-
Returns:
-

dict – The dictionary with the text entries.

-
-
-
- -
- -
-
-class text.TextDetector(subdict: dict, analyse_text: bool = False, skip_extraction: bool = False, model_names: list | None = None, revision_numbers: list | None = None, accept_privacy: str = 'PRIVACY_AMMICO')
-

Bases: AnalysisMethod

-
-
-analyse_image() dict
-

Perform text extraction and analysis of the text.

-
-
Returns:
-

dict – The updated dictionary with text analysis results.

-
-
-
- -
-
-clean_text()
-

Clean the text from unrecognized words and any numbers.

-
- -
-
-get_text_from_image()
-

Detect text on the image using Google Cloud Vision API.

-
- -
-
-remove_linebreaks()
-

Remove linebreaks from original and translated text.

-
- -
-
-set_keys() dict
-

Set the default keys for text analysis.

-
-
Returns:
-

dict – The dictionary with default text keys.

-
-
-
- -
-
-text_ner()
-

Perform named entity recognition on the text using the Transformers pipeline.

-
- -
-
-text_sentiment_transformers()
-

Perform text classification for sentiment using the Transformers pipeline.

-
- -
-
-text_summary()
-

Generate a summary of the text using the Transformers pipeline.

-
- -
-
-translate_text()
-

Translate the detected text to English using the Translator object.

-
- -
- -
-
-text.privacy_disclosure(accept_privacy: str = 'PRIVACY_AMMICO')
-

Asks the user to accept the privacy statement.

-
-
Parameters:
-

accept_privacy (str) – The name of the disclosure variable (default: “PRIVACY_AMMICO”).

-
-
-
- +
+

text module

summary module

@@ -675,523 +441,8 @@
-
@@ -111,8 +106,6 @@
  • allowed_model_types (summary.SummaryDetector attribute)
  • allowed_new_model_types (summary.SummaryDetector attribute) -
  • -
  • ammico_prefetch_models() (in module utils)
  • analyse_image() (colors.ColorDetector method) @@ -120,10 +113,6 @@
  • (faces.EmotionDetector method)
  • (summary.SummaryDetector method) -
  • -
  • (text.TextDetector method) -
  • -
  • (utils.AnalysisMethod method)