Skip to content

Instantly share code, notes, and snippets.

@nikkisharma536
Created December 28, 2019 23:23
Show Gist options
  • Save nikkisharma536/af9eb55971d98d2ee80fdd8554bfe42a to your computer and use it in GitHub Desktop.
Save nikkisharma536/af9eb55971d98d2ee80fdd8554bfe42a to your computer and use it in GitHub Desktop.
from math import nan
words = list(set(data["word"].values))
n_words = len(words)
tags = []
for tag in set(data["tag"].values):
if tag is nan or isinstance(tag, float):
tags.append('unk')
else:
tags.append(tag)
n_tags = len(tags)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment