Skip to main content

Text analysis library based on the Annotated Suffix Tree method

Project description

EAST

EAST stands for Enhanced Annotated Suffix Tree method for text analysis.

How to

Keyphrases table

The basic use case for the AST method is to calculate matching scores for a set of keyphrases against a set of text files (the so-called keyphrase table). To do that with east, launch it as follows:

$ east [-s] [-d] [-a <ast_algorithm>] keyphrases table <keyphrases_file> <directory_with_txt_files>

  • The -s option stands for synonyms and determines whether the matching score should be computed taking into account the synonyms extracted from the text file.

  • The -d option stands for denormalized and specifies whether the the matching score should be computed in the denormalized form (normalized by default, see [Mirkin, Chernyak & Chugunova, 2012].

  • The -a option stands for algorithm and defines the actual AST method implementation to be used. Possible arguments are “easa” (Enhanced Annotated Suffix Arrays), “ast_linear” (Linear-time and -memory implementation of Annotated Suffix Trees) and “ast_naive” (a slow and memory-consumptive implementation, present just for comparison).

  • Please note that you can also specify the path to a single text file instead of that for a directory. In case of the path to a directory, only .txt files will be processed.

The output comes in the XML format:

<table>
  <keyphrase value="KEYPHRASE_1">
    <text name="TEXT_1">0.250</text>
    <text name="TEXT_2">0.234</text>
  </keyphrase>
  <keyphrase value="KEYPHRASE_2">
    <text name="TEXT_1">0.121</text>
    <text name="TEXT_2">0.000</text>
  </keyphrase>
  <keyphrase value="KEYPHRASE_3">
    <text name="TEXT_1">0.539</text>
    <text name="TEXT_3">0.102</text>
  </keyphrase>
</table>

Keyphrases graph

The east software also allows to construct a keyphrases relation graph, which indicates implications between different keyphrases according to the text corpus being analysed. The graph construction algorithm is based on the analysis of co-occurrences of keyphrases in the text corpus. A keyphrase is considered to imply another one if that second phrase occurs frequently enough in the same texts as the first one (that frequency is controlled by the significance level parameter). A keyphrase counts as occuring in a text if its presence score for that text ecxeeds some threshold [Mirkin, Chernyak, & Chugunova, 2012].

$ east [-s] [-d] [-f graph_format] [-l significance_level] [-t score_threshold] [-a <ast_algorithm>] keyphrases graph <keyphrases_file> <directory_with_txt_files>

  • The -s, -d and -a options configure the algorithm of computing the matching scores (exactly as for the keyphrases table command).

  • The -f stands for format and determines in which format the resulting graph should come to the output. Possible values are:
    • “gml” (Graph Modelling Language, which can be used for graph visualization in tools like Gephi);

    • “edges”, which is just a list of edges in form Some keyphrase -> <List of keyphrases it points to> (simple but convenient for a quick analysis of implications between keyphrases).

  • The -l option stands for level of significance and controls the significance level above which the implications between keyphrases are considered to be strong enough to be added as graph arcs. The significance level should be a float in [0; 1] and is 0.6 by default.

  • The -t option stands for threshold of the matching score and controls the minimum matching score value where keyphrases start to be counted as occuring in the corresponding texts. It should be a float in [0; 1] and is 0.25 by default.

Sample output in the edges format:

KEYPHRASE_1 -> KEYPHRASE_3
KEYPHRASE_2 -> KEYPHRASE_3, KEYPHRASE_4
KEYPHRASE_4 -> KEYPHRASE_1

The same graph in gml:

graph
[
  node
  [
    id 0
    label "KEYPHRASE_1"
  ]
  node
  [
    id 1
    label "KEYPHRASE_2"
  ]
  node
  [
    id 2
    label "KEYPHRASE_3"
  ]
  node
  [
    id 3
    label "KEYPHRASE_4"
  ]
  edge
  [
    source 0
    target 2
  ]
  edge
  [
    source 1
    target 2
  ]
  edge
  [
    source 1
    target 3
  ]
  edge
  [
    source 3
    target 0
  ]
]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

EAST-0.2.tar.gz (19.1 kB view details)

Uploaded Source

File details

Details for the file EAST-0.2.tar.gz.

File metadata

  • Download URL: EAST-0.2.tar.gz
  • Upload date:
  • Size: 19.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for EAST-0.2.tar.gz
Algorithm Hash digest
SHA256 c6fd5132eea4757f3c23e72c7055126bcbf903628d7b3f4dfe8bc2da6e91be8e
MD5 e6a1cf46e4c87d8b1b16057544c72393
BLAKE2b-256 448f8bd89d7ef671fb8de336515552f84b35e05eba5045d7dda1e16876a8b838

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page