Are Synonymous?ΒΆ

Example

>>> # TEST PREPARATION
>>> import sys
>>> from io import StringIO
>>> from techminer2.thesaurus.descriptors import InitializeThesaurus, AreSynonymous
>>> # Redirecting stderr to avoid messages
>>> original_stderr = sys.stderr
>>> sys.stderr = StringIO()
>>> # Create the thesaurus
>>> InitializeThesaurus(root_directory="examples/fintech/", quiet=True).run()
>>> # Populate stopwords
>>> (
...     AreSynonymous()
...     .with_core_area("fintech (financial technologies)")
...     .having_n_contexts(10)
...     .having_terms_in_top(40)
...     .having_terms_ordered_by("OCC")
...     .having_term_occurrences_between(None, None)
...     .having_term_citations_between(None, None)
...     .having_terms_in(None)
...     .where_root_directory("examples/fintech/")
... ).run()
               lead_term                                    candidate_terms
11  FINANCIAL_INDUSTRIES           FINANCIAL_SECTOR; FINANCIAL_TECHNOLOGIES
12  FINANCIAL_INNOVATION                                 FINTECH_INNOVATION
14      FINANCIAL_MARKET  FINANCIAL_SERVICE; FINANCIAL_SYSTEM; FINTECH_M...
27   INFORMATION_SYSTEMS                             INFORMATION_TECHNOLOGY
>>> # Capture and print stderr output
>>> output = sys.stderr.getvalue()
>>> sys.stderr = original_stderr
>>> print(output)
               lead_term                                  candidate_terms
6   FINANCIAL_INDUSTRIES  FINANCIAL_SECTOR; FINANCIAL_SERVICES_INDUSTRIES
15     FINTECH_COMPANIES                                 FINTECH_STARTUPS
22  FINANCIAL_INNOVATION                               FINTECH_INNOVATION