Skip to content

Instantly share code, notes, and snippets.

@nikkisharma536
Created December 29, 2019 01:35
Show Gist options
  • Save nikkisharma536/c392e1cc9056a463f3cbba78160e6423 to your computer and use it in GitHub Desktop.
Save nikkisharma536/c392e1cc9056a463f3cbba78160e6423 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