Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added: Constituent-Treelib to: universe.json #13432

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
34 changes: 34 additions & 0 deletions website/meta/universe.json
Expand Up @@ -16,6 +16,40 @@
},
"category": ["extension"],
"tags": []
},
{
"id": "constituent_treelib",
"title": "Constituent Treelib",
"slogan": "Extract constituents with ease!",
"description": "Constituent Treelib (CTL) is a lightweight Python library built on top of benepar (Berkeley Neural Parser) as well as the two well-known NLP frameworks spaCy and NLTK. CTL offers you a convenient way to parse sentences into constituent trees, modify them according to their structure, as well as visualize and export them into various file formats. In addition, you can extract phrases according to their phrasal categories (which can be used e.g., as features for various NLP tasks), validate already parsed sentences in bracket notation or convert them back into sentences.",
"github": "Halvani/Constituent-Treelib",
"pip": "constituent-treelib",
"code_example": [
"from constituent_treelib import ConstituentTree, Language",
"# Define the language for the sentence as well as for the spaCy and benepar models",
"language = Language.English",
"# Define which specific SpaCy model should be used (default is Medium)",
"spacy_model_size = ConstituentTree.SpacyModelSize.Medium",
"# Create the pipeline (note, the required models will be downloaded and installed automatically)",
"nlp = ConstituentTree.create_pipeline(language, spacy_model_size)",
"# Your sentence",
"sentence = 'We try to explicitly describe the geometry of the edges of the images.'",
"# Create the tree from where we are going to extract the desired noun phrases",
"tree = ConstituentTree(sentence, nlp)",
"all_phrases = tree.extract_all_phrases(min_words_in_phrases=1)",
"print(all_phrases)",
"# {'PP': ['of the edges of the images', 'of the images'], 'NP': ['We', 'the geometry of the edges of the images', 'the geometry', 'the edges of the images', 'the edges', 'the images'], 'S': ['We try to explicitly describe the geometry of the edges of the images .', 'to explicitly describe the geometry of the edges of the images'], 'VP': ['try to explicitly describe the geometry of the edges of the images', 'to explicitly describe the geometry of the edges of the images', 'describe the geometry of the edges of the images'], 'ADVP': ['explicitly']}"
],
"code_language": "python",
"url": "https://github.com/Halvani/Constituent-Treelib",
"thumb": "https://github.com/Halvani/Constituent-Treelib/blob/main/assets/images/promo_tree.svg",
"author": "Oren Halvani",
"author_links": {
"github": "Halvani",
"website": "https://www.linkedin.com/in/orenhalvani"
},
"category": ["apis", "standalone", "visualizers"],
"tags": ["apis", "deployment", "constituency ", "parsing"]
},
{
"id": "sayswho",
Expand Down