aclowkay
aclowkay

Reputation: 3887

Entity tagging in ElasticSearch

I would like to tag particular entities from Elastic. Is this supported? e.g. For the text:

Hello my name is Johnny

To tag it to the tokens Hello my name is johnny < person

And later highlight those entities? Does anyone know of such thing or plugin or any point of direction would help.

Upvotes: 2

Views: 1782

Answers (2)

dshockley
dshockley

Reputation: 1494

Elasticsearch does not do named entity recognition. You could use an ingest processor, though, similar to this one https://github.com/spinscale/elasticsearch-ingest-opennlp (though you would probably have to modify it for your exact use case).

However, you're probably better off doing named entity recognition before indexing your documents. You could try openNLP or NLTK, or if it's a non-commercial project, the Stanford NER. I think you want to add the "highlight" tags yourself, also before indexing. I'm thinking of something like this:

<ne type="person">Johnny</ne> is from <ne type="place">New York</ne>

You can use a custom analyzer to discard the tags for analysis, or simply index two fields, one without the tags.

Upvotes: 2

mel
mel

Reputation: 2790

POS tagging

If you mean part-of-speech tagging Elasticsearch doesn't support it.

You should do it by yourself, using for example NLTK, then index your documents tagged.

Highlight

Concerning highlighting yes elasticsearch support it, here is the documentation:

Higlight

Upvotes: 1

Related Questions