Skip to content

FinNLP/fin-negation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

9 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Fin-negation

A negation detection for the Fin Natural language processor. It will exclude counter negated tokens.

Installation

npm i --save fin-negation

Usage

import * as Fin from "finnlp";
import "fin-negation";

const inputNegated = "That's not good";
const inputCounterNegated = "I wasn't here for only few hours!";

const negatedIns = new Fin.Run(inputNegated).negation();
const counterNegatedIns = new Fin.Run(inputCounterNegated).negation();

console.log(negatedIns);
console.log(counterNegatedIns);

The above example will give you:

[
    [
        false,
        false,
        false,
        true, // good is negated
    ]
]
[
    [
        false,
        false,
        false,
        false,
        false
        // ... all are false
        // no negation should be detected
        // because it's been counter negated
        // by the "only" token
    ]
]

About

๐Ÿ” [Detector] Negation detector for FIN NLP

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published