SentenceRepresentation
SentenceRepresentation copied to clipboard
Adding code to get sentence representations
I modified 2 files and added a new one.
- desent.py has a new function,
embedding, to get representations given a trained model and an input file with one sentence per line. Also, I fixed a minor problems with numpy.round(), which yielded a float rather than an integer. - build_dictionary.py now uses codecs tho handle input and output files. Otherwise, it considers only ansi-encoded characters.
- sentence_representation.py is a wrapper for convenience's sake. It invokes the relevant functions in desent.py and allows to modify the configuration easily.