r/computerscience • • Jan 12 '20

I made a search engine for computer science papers. Uses state of the art machine learning / NLP techniques (Bert) for a natural language search, so it's less dependent of specific keywords and keyphrases.

https://i.imgur.com/AEnLxK3.png

This can be thought of as a Bert-based search engine for computer science research papers.

https://thumbs.gfycat.com/DependableGorgeousEquestrian-mobile.mp4

https://github.com/Santosh-Gupta/NaturalLanguageRecommendations

Brief summary: We used the Semantic Scholar Corpus and filtered for CS papers. The corpus has data on papers' citation network, so we trained word2vec on those networks. We then used these citation embeddings as a label for the output of Bert, the input being the abstract for that paper.

This is an inference colab notebook

https://colab.research.google.com/github/Santosh-Gupta/NaturalLanguageRecommendations/blob/master/notebooks/inference/DemoNaturalLanguageRecommendationsCPU_Autofeedback.ipynb#scrollTo=wc3PMILi2LN6

which automatically and anonymously records queries, that we'll just to test future versions of our model against. If you do not want to provide feedback automatically, here's a version where feedback can only be send manually:

https://colab.research.google.com/github/Santosh-Gupta/NaturalLanguageRecommendations/blob/master/notebooks/inference/DemoNaturalLanguageRecommendationsCPU_Manualfeedback.ipynb

We are in the middle of developing much more improved versions of our model; more accurate models which contain more papers (we accidentally filtered a bunch of important CS papers in the first version), but we had to submit our initial project for a Tensorflow Hackathon, so we decided to do an initial pre-release, and use the opportunity to perhaps collect some user data in further qualitative analysis of our models. Here is our hackathon submission:

https://devpost.com/software/naturallanguagerecommendations


As a sidequest, we also build a TPU-based vector similarity search library. We are eventually going to be dealing with 9 figures of paper embeddings of size 512 or 256. TPUs have a ton of memory, and are very fast, so it might be helpful when dealing with a ton of vectors.

https://i.imgur.com/1LVlz34.png

https://github.com/srihari-humbarwadi/tpu_index


Stuff we used: Keras / Tensorflow 2.0, TPUs, SciBert, HuggingFace, Semantic Scholar.

Let me know if you have any questions.

192 Upvotes

3 comments sorted by

1

u/ddofer Jan 16 '20

Neat project. How does it compare to naive W2V embeddings + elastic search or annoy/similar?

1

u/BatmantoshReturns Jan 16 '20

I actually haven't had a chance to check out W2V embeddings + elastic search. I didn't even know es was using embeddings now. I haven't even heard of annoy/similar.