All Projects → retextjs → Retext Keywords

retextjs / Retext Keywords

Licence: mit
plugin to extract keywords and key-phrases

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Retext Keywords

Getlang
Natural language detection package in pure Go
Stars: ✭ 110 (-53.97%)
Mutual labels:  natural-language
Natural Regex
Create regex from natural language
Stars: ✭ 147 (-38.49%)
Mutual labels:  natural-language
Opencog
A framework for integrated Artificial Intelligence & Artificial General Intelligence (AGI)
Stars: ✭ 2,132 (+792.05%)
Mutual labels:  natural-language
Ai Chatbot Framework
A python chatbot framework with Natural Language Understanding and Artificial Intelligence.
Stars: ✭ 1,564 (+554.39%)
Mutual labels:  natural-language
Retext Equality
plugin to check for possible insensitive, inconsiderate language
Stars: ✭ 118 (-50.63%)
Mutual labels:  natural-language
Awesome Sentence Embedding
A curated list of pretrained sentence and word embedding models
Stars: ✭ 1,973 (+725.52%)
Mutual labels:  natural-language
Assistantjs
TypeScript framework to build cross-platform voice applications (alexa, google home, ...).
Stars: ✭ 100 (-58.16%)
Mutual labels:  natural-language
Go Naturaldate
Natural date/time parsing for Go.
Stars: ✭ 217 (-9.21%)
Mutual labels:  natural-language
Parse English
English (natural language) parser
Stars: ✭ 137 (-42.68%)
Mutual labels:  natural-language
Retext
natural language processor powered by plugins part of the @unifiedjs collective
Stars: ✭ 2,119 (+786.61%)
Mutual labels:  natural-language
Nodejs Language
Node.js client for Google Cloud Natural Language: Derive insights from unstructured text using Google machine learning.
Stars: ✭ 113 (-52.72%)
Mutual labels:  natural-language
Pytextrank
Python implementation of TextRank for phrase extraction and summarization of text documents
Stars: ✭ 1,675 (+600.84%)
Mutual labels:  natural-language
Textlint
The pluggable natural language linter for text and markdown.
Stars: ✭ 2,158 (+802.93%)
Mutual labels:  natural-language
Natural logic interpreter
Automatically interpret and validate nested natural logic arguments based on rules of inference and propositional logic
Stars: ✭ 110 (-53.97%)
Mutual labels:  natural-language
Deeplearning.ai
该存储库包含由deeplearning.ai提供的相关课程的个人的笔记和实现代码。
Stars: ✭ 181 (-24.27%)
Mutual labels:  natural-language
Node Sdk
☄️ Node.js library to access IBM Watson services.
Stars: ✭ 1,471 (+515.48%)
Mutual labels:  natural-language
Freelb
Adversarial Training for Natural Language Understanding
Stars: ✭ 147 (-38.49%)
Mutual labels:  natural-language
Cs224d
Code for Stanford CS224D: deep learning for natural language understanding
Stars: ✭ 222 (-7.11%)
Mutual labels:  natural-language
Commit Autosuggestions
A tool that AI automatically recommends commit messages.
Stars: ✭ 207 (-13.39%)
Mutual labels:  natural-language
Programming Language Classifier
An example of how to use CreateML in Xcode 10 to create a Core ML model for classifying text
Stars: ✭ 172 (-28.03%)
Mutual labels:  natural-language

retext-keywords

Build Coverage Downloads Size Sponsors Backers Chat

retext plugin to extract keywords and key-phrases.

Install

npm:

npm install retext-keywords

Use

Say we have the following file, example.txt, with the first four paragraphs on term Extraction from Wikipedia:

Terminology mining, term extraction, term recognition, or glossary extraction, is a subtask of information extraction. The goal of terminology extraction is to automatically extract relevant terms from a given corpus.

In the semantic web era, a growing number of communities and networked enterprises started to access and interoperate through the internet. Modeling these communities and their information needs is important for several web applications, like topic-driven web crawlers, web services, recommender systems, etc. The development of terminology extraction is essential to the language industry.

One of the first steps to model the knowledge domain of a virtual community is to collect a vocabulary of domain-relevant terms, constituting the linguistic surface manifestation of domain concepts. Several methods to automatically extract technical terms from domain-specific document warehouses have been described in the literature.

Typically, approaches to automatic term extraction make use of linguistic processors (part of speech tagging, phrase chunking) to extract terminological candidates, i.e. syntactically plausible terminological noun phrases, NPs (e.g. compounds "credit card", adjective-NPs "local tourist information office", and prepositional-NPs "board of directors" - in English, the first two constructs are the most frequent). Terminological entries are then filtered from the candidate list using statistical and machine learning methods. Once filtered, because of their low ambiguity and high specificity, these terms are particularly useful for conceptualizing a knowledge domain or for supporting the creation of a domain ontology. Furthermore, terminology extraction is a very useful starting point for semantic similarity, knowledge management, human translation and machine translation, etc.

…and our script, example.js, looks as follows:

var vfile = require('to-vfile')
var retext = require('retext')
var pos = require('retext-pos')
var keywords = require('retext-keywords')
var toString = require('nlcst-to-string')

retext()
  .use(pos) // Make sure to use `retext-pos` before `retext-keywords`.
  .use(keywords)
  .process(vfile.readSync('example.txt'), done)

function done(err, file) {
  if (err) throw err

  console.log('Keywords:')
  file.data.keywords.forEach(function(keyword) {
    console.log(toString(keyword.matches[0].node))
  })

  console.log()
  console.log('Key-phrases:')
  file.data.keyphrases.forEach(function(phrase) {
    console.log(phrase.matches[0].nodes.map(stringify).join(''))
    function stringify(value) {
      return toString(value)
    }
  })
}

Now, running node example yields:

Keywords:
term
extraction
Terminology
web
domain

Key-phrases:
terminology extraction
terms
term extraction
knowledge domain
communities

API

retext().use(keywords[, options])

Extract keywords and key-phrases from the document.

The results are stored on file.data: keywords at file.data.keywords and key-phrases at file.data.keyphrases. Both are lists.

A single keyword looks as follows:

{
  stem: 'term',
  score: 1,
  matches: [
    {node: Node, index: 5, parent: Node},
    // …
  ],
  // …
}

…and a key-phrase:

{
  score: 1,
  weight: 11,
  stems: ['terminolog', 'extract'],
  value: 'terminolog extract',
  matches:  [
    {nodes: [Node, Node, Node], parent: Node},
    // …
  ]
}
options.maximum

Try to detect at most maximum words and phrases (number, default: 5).

Note that actual counts may differ. For example, when two words have the same score, both will be returned. Or when too few words exist, less will be returned. the same goes for phrases.

Contribute

See contributing.md in retextjs/.github for ways to get started. See support.md for ways to get help.

This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.

License

MIT © Titus Wormer

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].