Skip to content

zyx954/RestFul-on-wordEmbeddings

Repository files navigation

RestFul web service on WordEmbeddings functions

A little RestFul web service built by Dropwizard with a Non-Sql database (Cassandra) to provide wordEmbeddings functions.

Four functions are included, which are:

  • Query wordEmbeddings
  • Similarity of two words
  • Nearest words
  • Word analogy

Here is a website style demo from Turku BioNLP Group

To simplify running test, the jar files are provided in folder jar_file. Only the folder jar_file is needed to run this demo.

Two step to Run Demo

Prerequisites

  • Download the folder jar_file
  • Install Cassandra (3.0.8)
  • Download sample 67M and place into a folder (e.g. a folder named wordEmbeddingsData)
  • Install Java(1.8.0_101) if necessary

Running

  • Open Cassandra server : ./cassandra -f

  • Load data into Cassandra : java -jar ReadData.jar ./wordEmbeddingsData

  • To running the restful service: java -jar ./WordEmbeddingService.jar server ProjectConfiguation.yml

Usage test

  • query wordEmbeddings

    • URL : http://localhost:8080/Get_Vec?fileName=vectors_ap8889_skipgram_s200_w20_neg20_hs0&queryWord=apple
    • Result : 1
  • words similarity

    • URL : http://localhost:8080/Cal_MosrSimilarWords?fileName=vectors_ap8889_skipgram_s200_w20_neg20_hs0&queryWord=apple
    • Result :2
  • most similar words

    • URL : http://localhost:8080/Cal_Similarity?fileName=vectors_ap8889_skipgram_s200_w20_neg20_hs0&queryWord1=cat&queryWord2=dog
    • Result : 3
  • words analogy

    • URL : http://localhost:8080/Cal_analogyWords?fileName=vectors_ap8889_skipgram_s200_w20_neg20_hs0&startWord=man&endWord=woman&queryWord=king
    • Result : 4

Built With

  • Database : Cassandra (3.0.8)
  • DB driver : dropwizard-cassandra (4.0.0)
  • Web Framework : dropwizard (1.0.0)
  • Maven (4.0.0)
  • Java (1.8.0_101)
  • sample 67M from Dr. Zuccon

 

Releases

No releases published

Packages

No packages published

Languages