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

Nearest Neighbor search on Word Embeddings #9

Open
raman-r-4978 opened this issue Jul 27, 2020 · 4 comments
Open

Nearest Neighbor search on Word Embeddings #9

raman-r-4978 opened this issue Jul 27, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@raman-r-4978
Copy link

Hi,

Just wanted to know that Is it possible to execute this ./fasttext nn model.bin command, via JAVA call?

reference

@carschno
Copy link
Owner

Yes, nn should work, although it is not really tested. Have you tried it?

@raman-r-4978
Copy link
Author

Thanks for the reply

Yes it is possible, when I execute

jft.runCmd(
	new String[]{
	    "nn",
    	    "model.bin"
    }
);

By default nn takes input from stdin. Check here

Is there any way to bring this functionality into Java. Something like this,

jft.loadModel("model.bin");
List<NearestNeighbors> nn = jft.getNearestNeighbors("sampleWord", 10);

Hope you get me now.
Thanks

@carschno
Copy link
Owner

I'm afraid this feature is not implemented indeed. You mentioned you had a fork implementing; feel free to create a pull request from it!

@raman-r-4978
Copy link
Author

I have no experience with bindings and JNI. Could you give some tips on this? That would be helpful for me to develop this feature.

Thanks

@carschno carschno added the enhancement New feature or request label Nov 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants