Python Forum
Ask for explaining wmd-relax
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Ask for explaining wmd-relax
#1
In https://github.com/src-d/wmd-relax is implemented Fast Word Mover's Distance.
Distance between words I try compute by shortest path of Wordnet.(comparing)

Here is code:
import numpy
from wmd import WMD

embeddings = numpy.array([[0.1, 1], [1, 0.1]], dtype=numpy.float32)
nbow = {"first":  ("#1", [0, 1], numpy.array([1.5, 0.5], dtype=numpy.float32)),
        "second": ("#2", [0, 1], numpy.array([0.75, 0.15], dtype=numpy.float32))}
calc = WMD(embeddings, nbow, vocabulary_min=2)
print(calc.nearest_neighbors("first"))
is small vocabulary_min=2
but
1.what means embeddings = [[0.1, 1], [1, 0.1]]
2.what is [0, 1]
3.what is [1.5, 0.5]
how compare
"Politician speaks to the media in Illinois."
"The president greets the press in Chicago."
especially without word2vec but shortest path?
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020