<jupyter_start><jupyter_text>El tamaño del Brown Corpus es de: 1161192<jupyter_code>brown.tagged_words().count(race1)
brown.tagged_words().count(race2)<jupyter_output><empty_output><jupyter_text>El mas frecuente en el Brown Corpus es el sustantivo<jupyter_code>from nltk.corpus import brown
unigram_tagger = nltk.tag.UnigramTagger(brown.tagged_sents(categories = 'news')[:5000])
from nltk import word_tokenize
S = "The Secretariat is expected to race tomorrow"
S_tok = word_tokenize(S)
unigram_tagger.tag(S_tok)
hmm_tagger = nltk.hmm.HiddenMarkovModelTrainer().train_supervised(brown.tagged_sents(categories='news')[:5000])
hmm_tagger.tag(S_tok)
bank_phrase = "As safe as the Bank of England"
bank_tok = word_tokenize(bank_phrase)
unigram_tagger.tag(bank_tok)
hmm_tagger.tag(bank_tok)
another_bank = "We bank at their head offices."
another_bank_tok = word_tokenize(another_bank)
unigram_tagger.tag(another_bank_tok)
hmm_tagger.tag(another_bank_tok)
news_title = "Juvenile Court to Try Shooting Defendant"
news_tok = word_tokenize(news_title)
hmm_tagger.tag(news_tok)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09936189608021878, 'fraction_numerical': 0.015496809480401094, 'mean_word_length': 9.358490566037736, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '640616', 'license': 'MIT', 'n_tokens_mistral': 450, 'n_tokens_neox': 409, 'n_words': 75, 'path': 'lab2.ipynb', 'repo_name': 'juanmabrea/nlp', 'size': '1097'}