• Stars
    star
    314
  • Rank 130,123 (Top 3 %)
  • Language
    Python
  • License
    Other
  • Created over 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Sentence2vec by Rock

Sentence 2 vec

Simple Python 3.x implementation of the algorithm by Rock de Vocht based on gloVe vectors

# install glove vectors
mkdir glove
cd glove
curl https://nlp.stanford.edu/data/glove.6B.zip
unzip glove.6B.zip
cd ..
# run the demo
python3 sentence2vec_demo.py

example usage, see sentence2vec_demo.py which reads the text file semantic_test_text.txt and finds the best match for each item that isn't a 100% match.

Sample output of this program:

best match "I like my phone" => "my phone I like" (score 1.0)
best match "my phone I like" => "I like my phone" (score 1.0)
best match "My phone is not good ." => "Your cellphone is not great ." (score 0.982)
best match "Your cellphone is not great ." => "My phone is not good ." (score 0.982)
best match "Will it snow tomorrow ?" => "It will be cold tomorrow ." (score 0.9469)
best match "It will be cold tomorrow ." => "Will it snow tomorrow ?" (score 0.9469)
best match "Recently a lot of hurricanes have hit the US" => "the US has lots of hurricanes" (score 0.9667)
best match "the US has lots of hurricanes" => "Recently a lot of hurricanes have hit the US" (score 0.9667)
best match "Eating strawberries keeps the doctors away" => "Eating strawberries is healthy" (score 0.8561)
best match "Eating strawberries is healthy" => "Eating strawberries keeps the doctors away" (score 0.8561)
best match "How old are you ?" => "what is your age ?" (score 0.9595)
best match "what is your age ?" => "How old are you ?" (score 0.9595)
best match "sales of water have increased dramatically ." => "water sales on the rise ." (score 0.9591)
best match "water sales on the rise ." => "sales of water have increased dramatically ." (score 0.9591)
best match "Had they at the start been generous towards Philippa , and elevated her to the front and centre position ." => "generously elevated to a centre position ." (score 0.9425)
best match "generously elevated to a centre position ." => "Had they at the start been generous towards Philippa , and elevated her to the front and centre position ." (score 0.9425)

More Repositories

1

enhanced-subject-verb-object-extraction

Enhanced Subject Word Object Extraction
Python
147
star
2

wsd-training

Create training data for Word Sense Disambiguation (WSD) and perform WSD using deep learning in Python using Keras/Tensorflow.
Java
5
star
3

ExtractiveSummarisation

High Quality Extractive Text Summarisation using the Stanford Parser in Java
Kotlin
3
star
4

vaderSentiment

VADER Sentiment Analysis. VADER (Valence Aware Dictionary and sEntiment Reasoner) is a lexicon and rule-based sentiment analysis tool that is specifically attuned to sentiments expressed in social media, and works well on texts from other domains. This is the converted Java version of the original Python project.
Java
3
star
5

goparser

A spaCy micro-service based parser GO interface.
Python
2
star
6

freebase-cassandra

Freebase Cassandra upload - Java utility for uploading freebase easy to Apache Cassandra
Java
2
star
7

tts

Simple text to speech server in docker using coqui-ai/TTS
Python
2
star
8

k-ai

The K-AI, an online Q/A system using Cassandra, Freebase, and custom data handling.
Go
1
star
9

flask-llama2

A small python sample showing how to serve a 3b llama2 model for GPU using flask
Python
1
star
10

compositions

Rock's compositions / music
Batchfile
1
star
11

pocketsphinx

Experiments with pocket sphinx
Python
1
star
12

gforce-x

Old C++ Windows d3d9 game, installer (msi) included below.
C++
1
star
13

wgck

War Games Construction Kit, ancient shareware game 2001
Logos
1
star
14

kai-java

KAI document management system (java)
JavaScript
1
star
15

vader

VADER Sentiment Analysis. VADER (Valence Aware Dictionary and sEntiment Reasoner) is a lexicon and rule-based sentiment analysis tool that is specifically attuned to sentiments expressed in social media, and works well on texts from other domains. This is the converted Kotlin version of the original Python project.
Kotlin
1
star
16

rock-datastructures

Set of data structures created by Rock
Kotlin
1
star