Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def text_from_tagged_ngram(ngram):
- if type(ngram) == tuple:
- return ngram[0]
- return " ".join(zip(*ngram)[0]) # zip(*ngram)[0] returns a tuple with words from a (word,tag) list
- return " ".join(list[zip(*ngram)[0]])
- TypeError: 'zip' object is not subscriptable
- list(zip(*ngram))[0]
- next(zip(*ngram))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement