Chatbots

How Phrase Structure helps Machine Learning

This post dives into one of the topics of a previous post “How to Make Machine Learning more effective using Linguistic Analysis“. We referred to the strong points of Machine Learning technology for insight extraction.

We also stated that text analysis is not the area where machine learning shines the most. Here we go into some detail on this last statement.

Statistical techniques are good for analyzing highly complex phenomena that are hard to model because our knowledge of them is scarce. Two examples:

  • the weather or
  • the stock markets.

On language, however, we have accumulated plenty of knowledge for centuries, in the form of grammars and dictionaries typically. We know, for example, that sentences have a structure that determines meaning and machine learning ignores sentence structure.

 

Most (if not all) commercial solutions for text analysis based on machine learning technology take a “bag of words” approach.

Simply put, this means that all words in a sentence (or paragraph or document) are put in a list or “bag”, where the relationships between words are lost (*).

The immediate consequence is that in a sentence like “Google acquired ACME” we lose the information on who’s the acquirer and who’s acquired, because exploiting the knowledge embedded in the sentence structure becomes impossible.

Other strategies like stemming lead to “semantically” relating words that are not related like “good” and “goods”, or “new” and “news”. These issues get worse in multilingual scenarios, where language morphology can be more complex.

Ignoring the structure of a sentence can lead to various types of analysis problems. The most common one is incorrectly assigning similarity to two unrelated phrases such as “Social Security in the Media” and “Security in Social Media” just because they use the same words (although with a different structure).

Besides, this approach has stronger effects for certain types of “special” words like “not” or “if”. In a sentence like “I would recommend this phone if the screen was bigger”, we don’t have a recommendation for the phone, but this could be the output of many text analysis tools, given that we have the words “recommendation” and “phone”, and given that the connection between “if” and “recommend” is not detected.

One typical example in everyday business is the detection of topic in sentiment analysis: in a sentence like “I did enjoy my new car in Madrid”, it’s very helpful for insight extraction to understand that the positive sentiment is about the new car, and not about Madrid. Using machine learning this task becomes impossible in practice.

(*) Some solutions integrate statistical and linguistic knowledge, like the Stanford parser, covered in this post in our blog.

 

Did you like this post? Remember to leave your comments and share!

You could be interested in our Methodology where you could find the process we do setting up and training a bot.

admin

Recent Posts

Bitext Linguistic Analyzer Improves Elasticsearch’s English Search Quality

Our earlier German MIRACL benchmark showed that linguistic analysis can substantially improve lexical search in…

18 hours ago

Hybrid Search Is the New Baseline: Better Lexical Search Is the Next Advantage

Vector search, also known as semantic search, has transformed enterprise search in the past few…

2 months ago

Bitext Linguistic Analyzer beats every Elasticsearch Configuration on German Search Quality

In a search benchmark for German, Bitext Linguistic Analysis SDK returned more relevant results and…

2 months ago

Stemming kills AI Accuracy: Why German Search Needs Lemmatization

Search systems have relied on stemming for decades. The reason is simple: stemming is fast,…

3 months ago

Some of your RAG-related issues have an easy & quick solution: decompounding

Most teams working with Elasticsearch, OpenSearch or RAG pipelines focus on ranking, embeddings or model…

5 months ago

Some of your RAG-related issues have an easy & quick solution: lemmatization

Some RAG issues have a simpler fix than people think: better text normalization. One common…

5 months ago