Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement get word vectors #12

Closed
doodyparizada opened this issue Dec 11, 2017 · 1 comment
Closed

implement get word vectors #12

doodyparizada opened this issue Dec 11, 2017 · 1 comment
Labels

Comments

@doodyparizada
Copy link
Owner

doodyparizada commented Dec 11, 2017

given a list of word indexes, return a list of word vectors.

request

GET /words/vector/ids=1,2,3,4,5

response

{
  "words": {
    "1": {"vector": [0.1,0.2,0.3,....]},
    "2": {"vector": [0.1,0.2,0.3,....]},
...
  }
}```
@doodyparizada
Copy link
Owner Author

doodyparizada commented Dec 11, 2017

example:

In [18]: requests.get('http://localhost:5000/words/vector', params={'ids': '1,2,3,4,5'}).json()
Out[18]:
{u'words': {
  u'1': {u'vector': [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1]},
  u'2': {u'vector': [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1]},
  u'3': {u'vector': [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1]},
  u'4': {u'vector': [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1]},
  u'5': {u'vector': [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1]}}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant