Two-digit word algorithm (Lesk's algorithm)

Hii .. Can anyone help me find an algorithm in Java code for finding synonyms of a search word based on context and I want to implement the algorithm with WordNet database.

For example, "I am starting a Java program." From context, I want to find synonyms for the word "running", but the synonyms should be appropriate according to the context.

+2


a source to share


5 answers


Let me illustrate a possible approach:

  • Let your offer be A B C

  • Let each word have synsets, i.e. {A:(a1, a2, a3), B:(b1), C:(c1, c2)}

  • Now form the possible syntax sets: (a1, b1, c1), (a1, b1, c2), (a2, b1, c1) ... (a3, b1, c2)

  • Define a function F(a, b, c)

    that returns the distance (estimate) between (a, b, c).
  • Call F on every sync set.
  • Choose the set with the highest score.

First, the function F can simply return the product of the reciprocal number of nodes between two nodes:



Maximize (Product [i = 0 to len (offer); j = 0 to len (offer)] (1 / D (node_i, node_j)))

Later you can increase your difficulty.

+9


a source


This is the perfect document for your problem. Algorithm fit is not great, but I think it will be enough.



In this link you can find Java API for WordNet Search (JAWS).

+2


a source


Hi I need to take a look at this page when I was looking for an implementation of the lesk algorithm. I think this is included in the JAWS package . I havent used it yet, but I guess it helps

+1


a source


Here is a Perl implementation of the algorithm http://senserelate.sourceforge.net/ you can use it from Java code, but it requires some setup work.

0


a source


Right I have the same problem and need more information on how I find context based search word synonyms and I want to implement the algorithm with DBpedia

0


a source







All Articles