Pre-built Pipelines

Some pre-built pipelines come with the library’s source code. They are stored under the directory configs. The script test.py can load them with the -c flag, and server.py automatically finds them and serves them in the web service.

Summarization

This pipeline is used for extracting short summaries out of news documents.

%YAML 1.2
---
# Summarizes a text by extracting the most relevant sentences.
transformers:
    - pos_extract
    - sim_link
    - extend
    - unique
    - sentences
transformer_args:
    sempos: { noun: n }
    unique_gram: { hyper: [ True ] }
    extended_sentence_edges: [ HYP ]
operations:
    - op: cluster
      hubratio: 0.2
#    - op: markov_cluster
#      expand_factor: 10
#      inflate_factor: 2
#      max_loop: 10
#      mult_factor: 1
#    - op: louvain_cluster
linearizers:
    - cluster_extract
linearizer_args:
    summary_length: 100
    summary_margin: 10
    normalize_sentence_scores: True

Concept maps

This pipeline generates concept maps useful for conceptual blending. Additionally, it linearizes them into a prolog triplet format.

%YAML 1.2
---
# Extracts a concept map from a text.
transformers:
    - pos_extract
    - wordnet
    - numerals
    - adjectives
    - negation
    - genitive
    - prepositions
    - attr_class
    - verb_collapse
    - specific_edges
    - unique
    - lenient
transformer_args:
    sempos:
        noun: n
        adjective: j
    attach_adjectives: True
    keep_attached_adj: True
operations:
    - op: filter_edges
      remove:
        - isa
      rename:
        be: is
      frequency:
        max: 15
        min: 0
    - op: spot_domain
linearizers:
    - prolog