Skip to content

Instantly share code, notes, and snippets.

@khozzy
Last active November 2, 2017 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save khozzy/6e1d4f2b6de502370e84165549233b19 to your computer and use it in GitHub Desktop.
Save khozzy/6e1d4f2b6de502370e84165549233b19 to your computer and use it in GitHub Desktop.
import nltk, string
def untokenize(tokens):
return "".join([" "+i if not i.startswith("'") and i not in string.punctuation else i for i in tokens]).strip()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment