Questions
how to add n gram code for this program? import nltk from textblob import TextBlob from...

how to add n gram code for this program?

import nltk
from textblob import TextBlob
from collections import Counter

from nltk import FreqDist
file=open("veg.txt","r")
rd=file.read()

#sentiment
sentences= nltk.sent_tokenize(rd)
tb=(TextBlob (t).sentiment.polarity for t in rd)
tb=TextBlob(rd)
print(tb.sentiment.polarity)

#ner
words=[]
for sentence in sentences:
words.append(nltk.word_tokenize(sentence))
tags=[]
for word in words:
tags.append(nltk.pos_tag(word))
for tag in tags:
print(nltk.ne_chunk(tag))

#pos
print(tb.tags)

wordlist = rd.split()
wordfreq = []
for w in wordlist:
wordfreq.append(wordlist.count(w))
print("Word Frequency\n" + str(list(zip(wordlist, wordfreq))))

In: Computer Science

1. Microsoft sold 300 copies of a word document in the month of April for $10/copy,...

1. Microsoft sold 300 copies of a word document in the month of April for $10/copy, 200 copies of PowerPoint for $25/copy, and 140 copies of excel for $30/copy. In the month of May, they sold 200 copies of a word document for $15/copy, 150 copies of PowerPoint for $30/copy, and 150 copies of excel for $40/copy. What is the GDP deflator index for the month of April based on the April pricings? (our answer should only be a number ex. 15000) *

2 points

50

95

100

115

2. Microsoft sold 300 copies of a word document in the month of April for $10/copy, 200 copies of PowerPoint for $25/copy, and 140 copies of excel for $30/copy. In the month of May, they sold 200 copies of a word document for $15/copy, 150 copies of PowerPoint for $30/copy, and 150 copies of excel for $40/copy. What is the real GDP for the month of May using April costs? (our answer should only be a number ex. 15000) *

In: Economics

Suppose that an analyst used text mining to study a pool of “true or false” questions...

Suppose that an analyst used text mining to study a pool of “true or false” questions that appeared in exams and quizzes, and had the following observations:

80% of all statements are true

10% of all statements contain a cue word in the set {“Always”, “Never”, “All”}

2% of true statements contain a cue word and 40% of false statements contain a cue word

False statements tend to be brief (i.e., containing less than 10 words) and true statements tend to be long. Specifically, 30% of false statements are brief and only 5% of true statements are brief.

Use Bayes Theorem and Naïve Bayes method to answer the following questions.

Given that a statement contains a cue word, what is its probability of being a true statement? (7 credits)

How would you classify the following statement using Naïve Bayes principle, i.e., is it a true statement

or a false statement? Show your calculations. (8 credits)

Statement: “All models are wrong.”

In: Statistics and Probability

Evaluate the course registration system at your university. List the basic steps of a user’s dialog...

Evaluate the course registration system at your university. List the basic steps of a user’s dialog with the system. What are some of the problems with the system from the perspective of ease of learning and ease of use? In what ways is the system inflexible? In what ways is needed information not available? Is too much information provided that distracts from the task at hand? [1] 2. Create a word processing document using your favorite word processor. At the top of the document put your name, course, lab number and date. 3. Answer the questions listed in the problem description. 4. Save your document in the word processors default format using the following name: Unit08Lab_. 5. Save (or export) your document again, using the naming convention described above, but this time in PDF format. So Marilyn Monroe's document would look like this: Unit08Lab_mmonroe.pdf. This document can be read by my system no matter what kind of operating system you have or what kind of word processor you use.

In: Computer Science

Question 2: (A) Marketing Environment is the combination of external and internal factors and forces which...

Question 2:

(A) Marketing Environment is the combination of external and internal factors and forces which affect the company’s ability to establish a relationship and serve its customers. How the Marketing environmental influences and affect the business located in the UAE country. Explain in your own word with an example?
(5 Marks, Word Limit 200-350)
(B) Together partnership firm producing and selling different high quality daily necessary goods like milk products, fancy products, soft drinks etc. at high price compared to competitors. They have different branches all over the town. They also offer discounts and credit facility to the regular customs. The firm also sells its products not only in the malls and also various retail shops. It uses various communication methods to increase its sales.

(i) From the above case list and explain the marketing mix used by the Together partnership film.
(5 Marks, Word Limit 150-250)

please focuse in limited word ?

In: Accounting

A psychologist would like to examine how the rate of presentation affects people’s ability to memorize...

A psychologist would like to examine how the rate of presentation affects people’s ability to memorize a list of words. A list of 20 words is prepared. For one group of participants the list is presented at the rate of one word every ½ second. The next group gets one word every second. The third group has one word every 2 seconds, and the fourth group has one word every 3 seconds. After the list is presented, the psychologist asks each person to recall the entire list. The dependent variable is the number of errors in recall. The data from this experiment are as follows:

½ Second

1 Second

2 Seconds

3 Seconds

4

0

3

0

6

2

1

2

2

2

2

1

4

0

2

1

Step by step on SPSS

a. Can the psychologist conclude that the rate of presentation has a significant effect on memory? Test at the .05 level.

b. Use the Tukey HSD test to determine which rates of presentation are statistically different and which are not.

In: Math

this lab, you will write a shell script, called compare_cols.sh. This program should Read a CSV...

this lab, you will write a shell script, called compare_cols.sh. This program should

  • Read a CSV file from standard input (STDIN).
    • Note that in general, CSV files may contain quoted fields with embedded newlines. But for this assignment you can assume that there are no fields with embedded newlines, and therefore each new line represents a new row of the CSV file.
  • Print a single number (integer) to standard output (STDOUT): the count of the lines in the CSV file for which the first word occurring in column 3 of the CSV also occurs as a word in column 5 of the CSV.
    • For the purposes of this assignment, words are considered to be sequences of non-space characters delimited on either side by spaces or by the beginning/end of the text string.
    • Whitespace surrounding the integer output will be ignored for scoring.For example, in the following CSV row, the word "six" occurs at the beginning of column 3, and also as a word in column 5:
      one two three,four five,six seven,eight,nine six ten,eleven

Bashscript

In: Computer Science

Use C++ The ADT UnsortedType List function ‘DeleteItem(ItemType item)’ creates an endless loop error when trying...

Use C++

The ADT UnsortedType List function ‘DeleteItem(ItemType item)’ creates an endless loop error when trying to delete a word or key that is not in the list.

Example: Delete the word “letter” from the unsorted list.

Here are the lists contents before the DeleteItem(ItemType item) call:

super     formula travel     free        thick      Josephine            Clara      education

The question is ‘how can I exit gracefully from the DeleteItem(itemType Item) call when the word or key is not in the unsorted list and not get an endless loop but instead printing out a message that the word ‘letter’ is not in the loop? What code can be added?

void UnsortedType::DeleteItem(ItemType item)

{

NodeType* location;

NodeType* tempLocation;

location = listData;

if (item.ComparedTo(location->info) == EQUAL)

{

    tempLocation = location;

    listData = listData->next;

}

else

{

    while (!((item.ComparedTo((location->next)->info) == EQUAL)))

      location = location->next;

    tempLocation = location->next;

    location->next = (location->next)->next;

}

delete tempLocation;

length--;

}

In: Computer Science

Write a C program A simple method for encrypting data is that of ROT 13. The...

Write a C program

A simple method for encrypting data is that of ROT 13. The method takes each latin letter of plain text

and moves it to the next letter 13 times in latin alphabet (wrapping around if necessary). For those of

you who are unaware the latin alphabet is the following

a

b

c

d

e

f

g

h

i

j

k

l

m

n

o

p

q

r

s

t

u

v

w

x

y

z

This means the letter ‘a’ would become the letter ‘n’. The word “hello” would become “uryyb”. To

recover the original text you only need to apply ROT 13 to the encrypted text. The word “uryyb” under

ROT 13 becomes “hello”. Due to the simplicity of the encryption this method is no longer used in

practice.

Problem

For the first homework assignment of the semester you are to implement a similar encryption scheme

called ROT 13.5. In this encryption scheme whenever you encrypt a vowel (a, e, i, o, u) as plain text,

the next encrypted letter moves to the next letter 14 times in the latin alphabet. In all other cases a plain

text letter will be moved to the next letter 13 times. This means that the word “hello” becomes “urzyb”

under rot 13.5.

Input Specification

Input will start with a single positive integer n (n < 10). The next n lines contains a single word

consisting of lower case latin letters (no more than 100 characters in length). No extra whitespace will

be present.

Output Specification

For each word given in input your program is to output a line containing ONLY the word encrypted as

ROT 13.5 with no extra whitespace or characters in lowercase latin characters.

In: Computer Science

I am having trouble with a C++ code that I'm working on. It is a spell...

I am having trouble with a C++ code that I'm working on.

It is a spell checker program.

It needs to compare two arrays, a dictionary, and an array with misspelled strings that are compared to the strings in the dictionary. the strings that are in the second array that is not in the Dictionary are assumed to be misspelled.

All of the strings in the dictionary are lowercase without any extra characters so the strings that are passed into the second array must be cleaned of !@#$%^&*()_-+={}[]:;"'`<>,.?/|\ and made to be lowercase before the array is compared to the dictionary.

The algorithm for the main driver should go (something) like this (you are free to adjust this algorithm as needed):

  1. Prompt the user for the name of the file containing the dictionary of correctly spelled words.

  2. Read in the name of the given dictionary file.

  3. Open an input file stream associated with this filename.

  4. If the file associated with filename successfully opens:

    1. For each word in the dictionary file:

      1. Add the word to a “dictionary” LinkedSet.

    2. Close the dictionary file.

  5. Do while the user wants to spell check more files:

    1. Prompt the user for the name of a file to spell check.

    2. Read in the name of the given file.

    3. Open an input file stream associated with this file.

    4. If the file successfully opens:

      1. For each word in the file:

        1. Clean the word of extraneous characters.

        2. Convert the word to lowercase.

        3. Add the word to a “fileBeingSpellChecked” LinkedSet.

      2. Close the file being spell checked.

    5. Create a “difference” LinkedSet that holds the difference between the “fileBeingSpellChecked” set and the “dictionary” set (note that the “difference” set will contain only misspelled words).

    6. Display the contents of the “difference” LinkedSet.

    7. Clear the contents from the “fileBeingSpellChecked” LinkedSet.

    8. Clear the contents from the “difference” LinkedSet.

    9. Prompt the user whether they want to spell check another file.

    10. Get their response.

  6. Quit.

In: Computer Science