axa-group / nlp.js

An NLP library for building bots, with entity extraction, sentiment analysis, automatic language identify, and so more
MIT License
6.28k stars 621 forks source link

Builtin Entity Extraction #121

Closed armmmo closed 1 year ago

armmmo commented 5 years ago

there's no tutorial example for Builtin Entity Extraction, only show the results of the extraction, but not how to use it.

obaid commented 5 years ago

Would be great to see an example on this. +1

jesus-seijas-sp commented 5 years ago

Well, this is because the builtin entity extaction is done automatically without configuration and even without training a model.

const { NlpManager } = require('node-nlp');

async function main() {
  const manager = new NlpManager({ languages: ['en'] });
  const result = await manager.process('Today I will walk 5 miles');
  console.log(result.entities);
}

main();

Try this, it should show two entities in console: the date and the dimension

okhiroyuki commented 5 years ago

How about the following code?

Email Extraction

Code

            const { NerManager } = require('node-nlp');
            const manager = new NerManager({ threshold: 0.8 });
            const result = await manager.findEntities('My email is something@somehost.com please write me');
            console.log(JSON.stringify(result));

Result

[{
    "start": 12,
    "end": 33,
    "len": 22,
    "accuracy": 0.95,
    "sourceText": "something@somehost.com",
    "utteranceText": "something@somehost.com",
    "entity": "email",
    "resolution": {
        "value": "something@somehost.com"
    }
}]

IP Extraction

Code

            const { NerManager } = require('node-nlp');
            const manager = new NerManager({ threshold: 0.8 });
            const result = await manager.findEntities('My ip is 8.8.8.8');
            console.log(JSON.stringify(result));

Result

[{
    "start": 9,
    "end": 15,
    "len": 7,
    "accuracy": 0.95,
    "sourceText": "8.8.8.8",
    "utteranceText": "8.8.8.8",
    "entity": "ip",
    "resolution": {
        "value": "8.8.8.8",
        "type": "ipv4"
    }
}]
tassoman commented 4 years ago

How do I can contribute writing some code for italian builtin entity extraction?

aigloss commented 1 year ago

See https://github.com/axa-group/nlp.js/blob/master/CONTRIBUTING.md

jBernavaPrah commented 1 year ago

@tassoman Hi I'm also interested in the native Italian entity extraction. Did you do something?