# Linguistic analysis

**URL:** <https://discuss.elastic.co/t/linguistic-analysis/111297>\
**Category:** Elasticsearch\
**Created:** [December 12, 2017, 10:14am UTC](https://discuss.elastic.co/t/linguistic-analysis/111297 "2017-12-12T10:14:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![pavuk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pavuk/32/28914_2.png) [@pavuk](https://discuss.elastic.co/u/pavuk)\
**Post date:** [December 12, 2017, 10:14am UTC](https://discuss.elastic.co/t/linguistic-analysis/111297/1 "2017-12-12T10:14:55Z")

</div>

Hi Elasticsearch experts!

I would like to ask a question concerning the possibility of linguistic analysis. Can I handle the incoming text stream with the help of Elastic stack so that I get an analysis of key phrases, negative, positive or neutral mood of the text and so on?  
If there is such a possibility, please, tell me the right direction, what to read, how to try it and so on.

Thank you!

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [December 12, 2017, 11:18am UTC](https://discuss.elastic.co/t/linguistic-analysis/111297/2 "2017-12-12T11:18:19Z")

</div>

> [@pavuk](#):
>
> Can I handle the incoming text stream with the help of Elastic stack so that I get an analysis of key phrases, negative, positive or neutral mood of the text and so on?

It can be quite domain-specific. "Upset" in the context of Amazon seller reviews might be "didn't respond" while upset in the context of a restaurant review might be "cold"  
If you have some structured data e.g. a star rating then you can learn the words or phrases that are strong predictors for each rating. I recommend querying for a rating e.g. 1 or 2 stars and using the new [significant\_text](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-significanttext-aggregation.html) aggregation on `text` content indexed with [shingles](https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-shingle-tokenfilter.html) of size 2.

Using this approach on real review data I learned that the biggest predictor for a 3 star rating is the word "but" - as in, _"the service was good, but...."_

Hope this helps.

---

<div class="post-metadata">

**Author:** ![pavuk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pavuk/32/28914_2.png) [@pavuk](https://discuss.elastic.co/u/pavuk)\
**Post date:** [December 12, 2017, 12:22pm UTC](https://discuss.elastic.co/t/linguistic-analysis/111297/3 "2017-12-12T12:22:07Z")

</div>

> [@Mark\_Harwood](#):
>
> It can be quite domain-specific. "Upset" in the context of Amazon seller reviews might be "didn't respond" while upset in the context of a restaurant review might be "cold"
> 
> If you have some structured data e.g. a star rating then you can learn the words or phrases that are strong predictors for each rating. I recommend querying for a rating e.g. 1 or 2 stars and using the new significant\_text aggregation on text content indexed with shingles of size 2.
> 
> Using this approach on real review data I learned that the biggest predictor for a 3 star rating is the word "but" - as in, "the service was good, but...."

Yes, I understand your idea. Thank you. But it's a little not that. I meant the functionality of the Amazon Comprehend. Is it possible?

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [December 12, 2017, 12:50pm UTC](https://discuss.elastic.co/t/linguistic-analysis/111297/4 "2017-12-12T12:50:06Z")

</div>

Ah, I originally thought you were just looking for sentiment analysis.  
Here's a couple of links for broader NLP:

> **[Text Classification made easy with Elasticsearch
	  	 | Elastic](https://www.elastic.co/blog/text-classification-made-easy-with-elasticsearch)**
>
> Elasticsearch is widely used as a search and analytics engine. Its capabilities as a text mining API are not as well known. In the following article I'd like to show how text classification can be don...

  

> **[spinscale/elasticsearch-ingest-opennlp](https://github.com/spinscale/elasticsearch-ingest-opennlp)**
>
> elasticsearch-ingest-opennlp - An Elasticsearch ingest processor to do named entity extraction using Apache OpenNLP

---

<div class="post-metadata">

**Author:** ![pavuk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pavuk/32/28914_2.png) [@pavuk](https://discuss.elastic.co/u/pavuk)\
**Post date:** [December 12, 2017, 1:07pm UTC](https://discuss.elastic.co/t/linguistic-analysis/111297/5 "2017-12-12T13:07:15Z")

</div>

Great! Thank you! Will review it.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 9, 2018, 1:07pm UTC](https://discuss.elastic.co/t/linguistic-analysis/111297/6 "2018-01-09T13:07:30Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
