Skip to content

Commit

Permalink
lower() not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
MJK committed May 20, 2015
1 parent 07750b3 commit 6ddc080
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions word2vec-api.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
def filter_words(words):
if words is None:
return
return [word.lower() for word in words if word.lower() in model.vocab]
return [word for word in words if word in model.vocab]


class N_Similarity(Resource):
Expand All @@ -40,7 +40,7 @@ def get(self):
parser.add_argument('w1', type=str, required=True, help="Word 1 cannot be blank!")
parser.add_argument('w2', type=str, required=True, help="Word 2 cannot be blank!")
args = parser.parse_args()
return model.similarity(args['w1'].lower(), args['w2'].lower())
return model.similarity(args['w1'], args['w2'])


class MostSimilar(Resource):
Expand Down

0 comments on commit 6ddc080

Please sign in to comment.