I'm interested in implementing a program for natural language processing (aka ELIZA).

Assuming that I'm already storing semantic-lexical connections between the words and its strength.

What are the methods of dealing with words which have very distinct meaning?

Few examples:

  • 'Are we on the same page?'

    The 'page' in this context isn't a document page, but it's part of the phrase.

  • 'I'm living in Reading.'

    The 'Reading' is a city (noun), so it's not a verb. Otherwise it doesn't make any sense. Checking for the capital letter would work in that specific example, but it won't work for other (like 'make' can be either verb or noun).

  • 'I've read something on the Facebook wall, do you want to know what?'

    The 'Facebook wall' has nothing to do with wall at all.

In general, how algorithm should distinguish the word meaning and recognise the word within the context?

For example:

  • Detecting the word for different type of speech, so it should recognise whether it's a verb or noun.
  • Detecting whether the word is part of phrase.
  • Detecting word for multiple meaning.

What are the possible approaches to solve that problem in order to identify the correct sense of a word with the context?

  • 1
    $\begingroup$ Context, by predisposition that will lead to the type of word you are getting. Google have released the state of the art NLR for english. Please do a search and have a look at their code on github. Links will be on the Google artical. $\endgroup$
    – X3R0
    Commented Aug 12, 2016 at 17:15
  • $\begingroup$ Wikipedia has a summary of methods for resolving lexical ambiguity. $\endgroup$ Commented Jul 8, 2017 at 20:38

2 Answers 2


In general, how algorithm should distinguish the word meaning and recognise the word within the context?

I don't think anybody knows how to answer this for the general case. If they did, they'd have basically solved AGI. But we can certainly talk about techniques that get part of the way there, and approaches that could work.

One thing I would consider trying (and I don't know off-hand if anybody has tried this exact approach) is to model the disambiguation of each word as a discrete problem for a Bayesian Belief Network where your priors (for any given word) are based on both stored "knowledge" as well as the previously encountered words in the (sentence|paragraph|document|whatever). So if you "know", for example, that "Reading is a city in the UK" and that "place names are usually capitalized", your network should be strongly biased towards interpreting "Reading" as the city, since nothing in the word position in the sentence strongly contradicts that.

Of course I'm hand-waving around some tricky problems in saying that, as knowledge representation isn't exactly a solved problem either. But there are at least approaches out there that you could use. For example, you could use the RDF / triple based approach from the Semantic Web world. Finding a good way to merge that stuff with a Bayesian framework could yield some interesting results.

There has been a bit of research on "probabilistic RDF" that you could possibly use as a starting point. For example:


Use something like Word2Vec. If a particular node has two edges that are very far from each other, besides the node in question, split the node into word(1) and word(2) nodes.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .