http://tieba.baidu.com/p/6070002023
from nltk.corpus import brown
brown_tagged_sents=brown.tagged_sents(categories=‘news’)
brown_sents = brown.sents(categories=‘news’)
import nltk
nltk.download(‘brown’)
nltk.download(‘universal_tagset’)
import nltk.tag.brill
from nltk.corpus import brown
brown_tagged_sents = brown.tagged_sents(categories=‘news’, tagset=‘universal’)
brown_sents = brown.sents(categories=‘news’)
size = int(len(brown_tagged_sents) * 0.9)
train_sents = brown_tagged_sents[:size]
#set up first stage of tagging
print(size)
[nltk_data] Downloading package brown to
[nltk_data] C:\Users\Lenovo\AppData\Roaming\nltk_data…
[nltk_data] Package brown is already up-to-date!
[nltk_data] Downloading package universal_tagset to
[nltk_data] C:\Users\Lenovo\AppData\Roaming\nltk_data…
[nltk_data] Pac