简体   繁体   中英

How to use Apache OpenNLP to analyze text in a java web application?

I'm developing a java web application where users can enter their request to the web application through a text box.. I need to analyze user's text inputs (customer requests) and compare it with the web application database and give (view) the suitable suggestions or results to the customer ? Is it possible with OpenNLP ? please give me some advises.

This sounds like a "More Like This" kind of use case rather than an NLP use case, but it depends on some details . . .

If you need to extract specific product names from the customer request, then look them up, then you could train a Named Entity Recognition model (NER) on your data using OpenNLP's name finder. Although it may be overkill for this use case, because unless you have a ton of data with a ton of product names, you could probably just use a Regex match approach on a solid list of product names.

If you need to "fuzzy match" the whole customer request to other customer requests or to product descriptions or something, you would likely be better off using something like ElasticSearch to index your database entries, then pass in the customer request to the "more like this" function, which would return you N best matches (scored) on the fly. In fact, I would recommend this approach first, since it requires no model maintenance, no training data, no feature extraction etc that comes with NER.

HTH

Here's a link to the ElasticSearch MLT function Link

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM