NLP using python - NLP Using Python sentence =\"At eight o'clock on Thursday morning Arthur didn't feel very good tokens =

NLP using python - NLP Using Python sentence ="At...

This preview shows page 1 - 3 out of 10 pages.

-------------------------------------------------------------------------------- ---- NLP Using Python sentence = """At eight o'clock on Thursday morning... Arthur didn't feel very good.""" tokens = nltk.word_tokenize(sentence) print(tokens) tagged = nltk.pos_tag(tokens) print(tagged[0:6]) entities = nltk.chunk.ne_chunk(tagged) print(entities) from nltk.corpus import treebank t = treebank.parsed_sents('wsj_0001.mrg')[0] t.draw() wordfreq = nltk.FreqDist(words) wordfreq.most_common(2) [('programming', 2), ('.', 2)] word nltk.import nl nltk.download('book') from nltk.book import *. text1.findall("<tri.*r>") type(text1) n_unique_words = len(set(text1)) text1_lcw = [ word.lower() for word in set(text1) ] n_unique_words_lc = len(set(text1_lcw)) word_coverage1 = n_words / n_unique_words word_coverage2 = n_words / n_unique_words_lc big_words = [word for word in set(text1) if len(word) > 17 ] sun_words = [word for word in set(text1) if word.startswith('Sun') ] text1_freq = nltk.FreqDist(text1) fdist top3_text1 = text1_freq.most_common(3) ####TEXT CORPORA Popular Text Corpora Genesis: It is a collection of few words across multiple languages. Brown: It is the first electronic corpus of one million English words. Other Corpus in nltk Gutenberg : Collections from Project Gutenberg Inaugural : Collection of U.S Presidents inaugural speeches stopwords : Collection of stop words. reuters : Collection of news articles. cmudict : Collection of CMU Dictionary words. movie_reviews : Collection of Movie Reviews. np_chat : Collection of chat text. names : Collection of names associated with males and females. state_union : Collection of state union address.
wordnet : Collection of all lexical entries.---------------------------------------------------------------------------------------------------216618.55['noise','surprise','wise','apologise'] = 4How many times each unique word of text6 collection is repeated on an average? Count the number of words in text collection, text6, ending with ship? How many times does the word 'BROTHER' occur in text collection text6?What is the frequency of word 'ARTHUR' in text collection text6? Which of the following modules is used for performing Natural language processing in python? Which of the following expression is used to download all the required corpus and collections , related to NLTK Book ? What is range of length of words present in text collection text6? In how many number of categories, are all text collections of brown corpus grouped into?15Which of the following method is used to determine the number of characters present in a corpus?

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture