StopwordsΒΆ

Example

>>> import sys
>>> from io import StringIO
>>> from techminer2.thesaurus.descriptors import InitializeThesaurus, RemoveStopwords
>>> # Redirecting stderr to avoid messages
>>> original_stderr = sys.stderr
>>> sys.stderr = StringIO()
>>> # Create the thesaurus
>>> InitializeThesaurus(root_directory="examples/fintech/", quiet=True).run()
>>> # Remove initial stopwords
>>> RemoveStopwords(root_directory="examples/fintech/", tqdm_disable=True, use_colorama=False).run()
>>> # Capture and print stderr output
>>> output = sys.stderr.getvalue()
>>> sys.stderr = original_stderr
>>> print(output)  
Removing initial stopwords from thesaurus keys...
  File : examples/fintech/data/thesaurus/descriptors.the.txt
  557 initial stopwords removed successfully
  Removal process completed successfully

Printing thesaurus header
  File : examples/fintech/data/thesaurus/descriptors.the.txt

    ACADEMIC_FINANCE_COMMUNITY
      THE_ACADEMIC_FINANCE_COMMUNITY
    ACADEMICS
      ACADEMICS; BOTH_ACADEMICS; OTHER_ACADEMICS
    ACCEPTANCE
      THE_ACCEPTANCE
    ACTION
      OUR_ACTION
    ACTIVE_PARTICIPANT
      AN_ACTIVE_PARTICIPANT
    ACTORS
      ACTORS; ALL_ACTORS
    ADDITIONAL_COMPONENTS
      FIVE_ADDITIONAL_COMPONENTS
    ADOPTION
      ADOPTION; THE_ADOPTION