Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
handle long phrases + html improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
shira-g committed Jun 7, 2018
1 parent fec4ab3 commit 24d3656
Show file tree
Hide file tree
Showing 3 changed files with 191 additions and 137 deletions.
10 changes: 6 additions & 4 deletions set_expansion_demo/expand_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,20 @@ def handle(self):
self.data = str(self.request.recv(10240).strip(), 'utf-8')
logger.debug('request data: ' + self.data)
if self.data == 'get_vocab':
print('got vocab request')
print('getting vocabulary')
res = se.get_vocab()
else:
data = [x.strip() for x in self.data.split(',')]
seeds = data
res = se.expand(seeds)
print('expanding)')
res = se.expand(data)
print('compressing response')
packet = pickle.dumps(res)
print('response length= ' + str(len(packet)))
# length = struct.pack('!I', len(packet))
# packet = length + packet
print('sending response)')
print('sending response')
self.request.sendall(packet)
print('done')


if __name__ == "__main__":
Expand Down

0 comments on commit 24d3656

Please sign in to comment.