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

NER - generalize learning to the whole entity #1227

Closed
iliubinskii opened this issue Dec 2, 2022 · 2 comments
Closed

NER - generalize learning to the whole entity #1227

iliubinskii opened this issue Dec 2, 2022 · 2 comments

Comments

@iliubinskii
Copy link

iliubinskii commented Dec 2, 2022

Is your feature request related to a problem? Please describe.

Consider this sample:

manager.addNamedEntityText("human", "John", ["en"], ["John"]);
manager.addNamedEntityText("human", "Lucy", ["en"], ["Lucy"]);
manager.addDocument("en", "Hi, John", "say.hello");
manager.addDocument("en", "Hi, dog", "None");
manager.addDocument("en", "Hi, cat", "None");
const res1 = await manager.process("en", "Hi, John"); // -> say.hello
const res2 = await manager.process("en", "Hi, Lucy"); // -> None

I am getting "None" for Lucy.
But I would expect "say.hello" because "Hi, %human%" learned from "Hi, John" applies both to John and Lucy.

Describe the solution you'd like

Add 4th option to addDocument.
Let's call it "applyToEntity?: boolean".

When it is skipped everything works as is.
If it is added then learning done for one option should apply to all options from entity.

In our example, if skipped - apply only to John.
If applyToEntity=true, apply to all humans.

If this is somehow already possible please describe.

Describe alternatives you've considered

No

Additional context

No

@Apollon77
Copy link
Contributor

Do you mean to use Enum values to automatically learn better? Then #1220 should bring what you want. Or what exactly you mean?

(But you would need add one document with "Hello @name" :-) )

@Apollon77
Copy link
Contributor

PS: maybe you would get better chances already now if you just add the mentioned document with "Hello @name" because then there should be a fallback try with enum contents ... try it

@aigloss aigloss closed this as not planned Won't fix, can't repro, duplicate, stale Dec 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants