Write a program that asks the user for a word. Next, open up the movie reviews.txt file and examine every review one at a time. If a review contains the desired word you should make a note of the review score in an accumulator variable. Finally, produce some output that tells your user how that word was used across all reviews as well as the classification for this word (any score of 2.0 or higher can be considered

Answers

Answer 1

Answer:

import numpy as np

word = input("Enter a word: ")

acc = []

with open("Downloads/record-collection.txt", "r") as file:

   lines = file.readlines()

   for line in lines:

       if word in line:

           line = line.strip()

           acc.append(int(line[0]))

   if np.mean(acc) >= 2:

       print(f"The word {word} is a positive word")

       print(f"{word} appeared {len(acc)} times")

       print(f"the review of the word {word} is {round(np.mean(acc), 2)}")

   else:

       print(f"the word {word} is a negative word with review\

{round(np.mean(acc), 2)}")

Explanation:

The python program gets the text from the review file, using the user input word to get the definition of reviews based on the word, whether positive or negative.

The program uses the 'with' keyword to open the file and created the acc variable to hold the reviews gotten. The mean of the acc is calculated with the numpy mean method and if the mean is equal to or greater than 2 it is a positive word, else negative.


Related Questions

Any one know??please let me know

Answers

Answer:

B

Explanation:

Answer:

The answer is B.

Explanation:

Also I see your using schoology, I use it too.

Generally speaking, digital marketing targets any digital device and uses it to advertise and sell a(n) _____.


religion

product or service

governmental policy

idea

Answers

Answer:

product or service

Explanation:

Digital marketing is a type of marketing that uses the internet and digital media for the promotional purposes. It is a new form of marketing where the products are not physically present. The products and services are digitally advertised and are used for the popularity and promotion. Internet and digital space are involved in the promotion. Social media, mobile applications and websites are used for the purpose.

Answer:

A.) Product or service

Explanation:

Digital marketing is the practice of promoting products or services through digital channels, such as websites, search engines, social media, email, and mobile apps. The goal of digital marketing is to reach and engage with potential customers and ultimately to drive sales of a product or service. It can target any digital device that can access the internet, and it can use a variety of techniques such as search engine optimization, pay-per-click advertising, social media marketing, content marketing, and email marketing to achieve its objectives.

The Bellman-Ford algorithm for the shortest path problem with negative edge weights will report that there exists a negative cycle if at least one edge can still be relaxed after performing nm times of relaxations. The algorithm, however, does not specify which cycle is a negative cycle. Design an algorithm to report one such cycle if it exists. You should make your algorithm runs as fast as possible.

Answers

Answer:

- Iterate over the Bellman-Ford algorithm n-1 time while tracking the parent vertex and store in an array.

- Do another iteration and if no relaxation of the edges occurs in the nth iteration then print of return "There are no negative cycle".

- Else, store the vertex of the relaxed edge at the nth iteration with a variable name.

- Then iterate over the vertexes starting from the store vertex until a cycle is found then print it out as the cycle of negative weight.

Explanation:

The Bellman-Ford algorithm can be used to detect a negative cycle in a graph. The program should iterate over the algorithm, in search of a relaxed edge. If any, the vertex of the specified edge is used as a starting point to get the target negative cycle.

Even with a quality burglary-resistant chest on the premises, special function locks may be appropriate because:________.
a. A dishonest worker might open the safe at night .b. A burglar may force a worker to open the safe during working hours.c. Without special locking devices, workers may be tempted to leave the safe unlocked for easy access during the day.d. All of the above

Answers

Answer:

d ) all of the above

Explanation:

is the correct answer

HELPPP
44 What text will be output by the program?
A- less than 10
B- less than 20
C- less than 30
D- 30 or more

Answers

Answer:

D. 30 or more

Explanation:

All other ones are canceled out ad the score adds 10.

The correct text for the output of the program is, ''30 or more''. So, option (D) is true.

A program is a set of instructions that a computer can run.

Programs are clear, ordered, and in a language that computers can follow.

Given that,

A program for the score is shown in the image.

Now, From the given program;

The last line will appear with the,

 console,log (''30 or more'')

Hence, The correct text for the output of the program is, ''30 or more''.

Therefore, the correct option is,

D) 30 or more

Read more about Python programs at:

brainly.com/question/26497128

#SPJ6

Which important aspect of the Roman Empire did the barbarians destroy?

Answers

Answer:

centers of learning

Explanation:

Under the leadership of Emperor Valens, Rome was already having financial hardships. This meant that it didn't have enough money left to repair its empire nor to strengthen it against invaders. Soon, the barbarians such as the Franks, Huns, Saxons, etc. started attacking Rome. They spent a lot of time destroying the outer regions of the empire because they were also at war with each other. They penetrated Rome and it soon fell. The barbarians didn't only destroy the cities but they also destroyed the "centers of learning." Roman people were known to value education. With the fall of the Roman Empire, so did education and sophisticated architectures follow.  

Answer:

i dont know but them barbs are crazy can't believe they were a thing back then

Explanation:

lol

why does this site suck so much?
Like why do I have to pay MONEY to get answers?

Answers

Answer:

you can answer ppl question to get points to ask questions

Explanation:

thats what i do and its free

Answer:

Money :))

They get revenue off of ads and that cash from your purchases to keep the site and themselves running.

AND REMEMBER: NOTHING IS FREEEEEEE

Oozie is still using a parameter called _______ to identify the YARN arguments as they are yet to create a new parameter for YARN itself.

Answers

Answer:

Job Tracker

Explanation:

Given that JobTracker is a term in computer engineering that describe the main or primary point whereby users can maintain and start submitting and tracking MR jobs in a network environment.

Hence, it can be concluded that Oozie is still using a parameter called JOB TRACKER to identify the YARN arguments as they are yet to create a new parameter for YARN itself.

Oozie is still using a parameter called Job Tracker

The following information should be considered:

JobTracker is a term in computer engineering that reoresent the main or primary point in which users can maintain,  start submitting, and tracking MR jobs in a network environment.It identified the YARN arguments for developing the new parameter.

Learn more: brainly.com/question/17429689

Identify security gaps or opportunities in training related to human factors. Describe the impact associated with not addressing each gap or opportunity to individuals and the organization.

Answers

Answer:

The description and as per the circumstance has been described in the following portion.

Explanation:

Security gaps including human factor-related opportunities are security-related education that should have been given to all workers as new employees were most vulnerable to potential hazards and may also unintentionally clicking on any of the suspicious URLs. Whether this distance isn't crossed, it could contribute to trouble like crying out and therefore vulnerability management attacks, leading to privacy concerns and a lack of brand performance.

g Assume that this program is run on a processor with data cache of size big enough that the entire array arr can fit in the cache. (a) How many paths does the function foo of this program have

Answers

Answer:

A. 2

Explanation:

The food function in the C source code uses two for loop statements to fill and array of size 100 with 100 values ranging from 1 to 100 and the second to get the total sum to the values in the array. With this, two program paths are created.

If you are a mathematics student and want to study the secret of writing cryptographic codes, algorithms, encryption and decryption techniques, then you are learning about cryptography.

If you are a cryptography student and want to write a PHD style paper on cryptography and cryptanalysis, then you are learning about cryptology.

If you work at the code breaking division at the National Security Agency (NSA), then you are part of which team?

A. Cryptosystems Team
B. Cryptanalysis Team
C. Cryptologist Team
D. Cracker Team​

Answers

Answer:

d

Explanation:

hi

having a bad day? enjoy this front view of phinias (can't spell his name)​

Answers

Answer:

ouch what happened to him

congrats you ruined my childhood

(thanks for the free points!!)

which computer is slightly bigger than a calculator? ​

Answers

Answer:

A computer pocket?

Explanation:

A computer pocket is the computer which is slightly bigger than a calculator.

What is computer?

Computer is defined as an electronic equipment or device that meant for storing data and just in a typical binary form, which has been just according to the instructions that is provided to it in the form of variable program.

Computer also helps to operating the arithmetic as well as logical operations by its own. The set of modern computers also perform generic sets that has operated which has been know as program.

The main advantage of computer is that it helps to increases the productivity of the work, it plays a vital role to connect with the secure internet, it helps to sort or organize as well as search the information. It also helps to keep connected to the world.

Therefore, A computer pocket is the computer which is slightly bigger than a calculator.

Learn more about computer here:

https://brainly.com/question/21080395

#SPJ2

C++ please
Write a program that does the following.
Create a dynamic two dimensional squarearray of unsigned integers (array_one). Prompt the user to enter the number of rows and columns they want (maximum of 30) (rows and columns must be the same for a square array)
Pass the array to a function that will initialize the two dimensional array to random numbers between 0 and 4000 using the rand() library function. Here is the kicker: The array cannot have any repeated values!
Create another dynamic two dimensional array of the same size (array_transpose)
Pass both arrays to a function that will generate the transpose of array_one returning the values in array_transpose. (If you don’t already know the transpose swaps the rows and columns of an array.) Example: Suppose you have a 4 x 4 array of numbers (array_one). The transpose is shown below (array_transpose)
Array One Array Transpose
1 2 3 4 1 5 9 13
5 6 7 8 2 6 10 14
9 10 11 12 3 7 11 15
13 14 15 16 4 8 12 16
Pass each array to a print_array function that will print (to the screen or a file) the results of a test case with a 20 by 20 array.

Answers

Answer:

#include <iostream>

#include <cstdlib>

#include <ctime>

using namespace std;

int main(){

   int n;

   cout<< "Enter the row and column length: ";

   cin>> n;

   int array_one[n][n];

   int array_transpose[n][n];

   for (int i = 0; i < n; i++){

      for (int j= 0; j < n; j++){

           srand((unsigned) time(0));

           array_one[i][j] = (rand() % 4000)

           array_transpose[j][i] = array_one[i][j];

       }

   }

}

Explanation:

The C source code has three variables, 'array_one', array_transpose' (both of which are square 2-dimensional arrays), and 'n' which is the row and column length.

The program loops n time for each nth number of the n size to assign value to the two-dimensional array_one. the assign values to the array_transpose, reverse the 'i' and 'j' values to the two for statements for array_one to 'j' and 'i'.

what is the operating system on an IBM computer?​

Answers

Answer:

OS/VS2 and MVS

Explanation:

IBM OS/2, is full International Business Machines Operating System/2, an operating system introduced in 1987 IBM and the Microsoft Corporation to operate the second-generation line of IBM personal computers, the PS/2 (Personal System/2.) hope this helps! Pleas mark me as brainliest! Thank you! :))

Which phrase is the best definition of sparklines in Excel 2016?

a type of graphic that users can insert into a worksheet
a type of mini chart that users can insert into a worksheet
a simple image that is displayed in Excel
a link to an outside source that is referenced in a worksheet

Answers

Answer:

Option 2: a type of mini chart that users can insert into a worksheet

Explanation:

A graph or chart is used to show trends and changes in a dataset.

When we have to show trends or changes in MS Excel, there are a lot of options available. One of them is Sparklines. Sparklines are like mini charts that can be used to show data graphically.

Hence,

The correct answer is:

Option 2: a type of mini chart that users can insert into a worksheet

Answer:

answer c

Explanation:

Most presentation programs allow you to save presentations so they can be viewed online by saving them as ____
files.

Answers

Explanation:

Most presentation programs allow you to save presentations so they can be viewed online by saving them as html

files.

Most presentation programs allow you to save presentations so they can be viewed online by saving them as html files.

help please with the question in the photo

Answers

Answer:

A

Explanation:

A because, why would someone want to listen to your own interests?

You are part of a sales group that has been asked to give a presentation.
Before you begin, what should you and your group do?
O A. Figure out who is the best public speaker.
O B. Look into file-sharing options so that everyone can work on the
same file at the same time.
OC. Buy the best software on the market.
O D. Ask if you have to give a slide presentation.

Answers

The answer is the 2 one becuase I took the test

Is it important to use varied methods when creating digital media presentations? Why or why not?


Yes, because no one method is capable of adequately delivering the information.

No, because using more than one method is confusing to the audience.

No, because the different methods are incompatible with each other.

Yes, because it makes the presentation more interesting for the audience.

Answers

The answer is yes becuase no one method is capable one becuase I took the test on edge

what is spread sheet software?​

Answers

Answer:

The answer to this question is given in the explanation section.

Explanation:

This is a type of software which show us data in tabular form. These software can easily store, analyze and organize data.

They are divided in rows and columns. They are mainly used for accounting and book keeping.

The commonly used spread sheet software in the market are MS Excel by Microsoft, Calc by libre office.

The function's only behavior should be to return the sum of array userVals' elements. What common error does the function make?
Assume userVals always has exactly 10 elements.
int SumArray Elements(int uservals[]) {
for (i = 1; i <10; ++i) {
userVals[i] = userVals[i] + userVals[i - 1]; } return userVals[i]; }
A. Attempts to access an invalid element.
B. Omits the first element from the sum.
C. Modifies userVals' elements.
D. Omits the last element from the sum.

Answers

Answer:

A. Attempts to access an invalid element.

Explanation:

The C program above is supposed to loops 10 times to get the total of the userVal's element, but the loop is assigning the cumulative sum of the to each nth index of the userVal array. Although the cumulative total of the array is assigned to the last index, the return statement is attempting to return an invalid element (since i is local only to the for loop statement). The program should return the userVal[9] instead.

does anyone know how to code

Answers

Answer:

no

Explanation:

i do not know how to code

The purpose of __________________ is to isolate the behavior of a given component of software. It is an excellent tool for software validation testing.a. white box testingb. special box testingc. class box testingd. black-box testing

Answers

Answer:

d.) black-box testing

Explanation:

Software testing can be regarded as procedures/process engage in the verification of a system, it helps in detection of failure in the software, then after knowing the defect , then it can be corrected. Black Box Testing can be regarded as a type of software testing method whereby internal structure as well as design of the item under test is not known by one testing it. In this testing internal structure of code/ program is unknown when testing the software, it is very useful in checking functionality of a particular application. Some of the black box testing techniques commonly used are; Equivalence Partitioning, Cause effect graphing as well as Boundary value analysis. It should be noted that the purpose of black-box testing is to isolate the behavior of a given component of software.

A photojournalist is more employable than a reporter or a photographer because they can perform more than one job

Answers

Answer:

so yes

Explanation:

According to the Miriam Webster Online Dictionary, photography is defined as the art or process of taking a picture with a camera. On the other hand, photojournalism is defined as using photographs to report news ,stories,ect

Sets of directions for problem solving refer to
A. algorithms
B. variables
C. functions
D. iteration

Answers

Answer:

B. Variables

Explanation:

I majored in

g A CPU is equipped with a cache; Accessing a word takes 20 clock cycles if the data is not in the cache and 5 clock cycles if the data is in the cache. What is the effective memory access time in clock cycles if the hit ratio is 90%

Answers

Answer:

6.5

Explanation:

The formula to calculate the efficiency is;

= (cache-click-cycle x hit ratio) + ( memory-clock-cycle x 1 - hit ratio)

= (5 x 0.9) + ( 20 x 0.1)

= 4.5 + 2

= 6.5

In this exercise we have to use the knowledge of efficiency, in this way, using the data already informed, we can say that the result of this is:

6.5 effective memory

In this exercise, it was informed that some conditions must be established, that is:

Hit radio: 90%Memory: 20Cache: 5

The formula to calculate the efficiency is;

[tex]efficiency= ((cache-click-cycle)(hit \ ratio)) + ( (memory-clock-cycle)(1 - hit \ ratio))[/tex]

Substituting the known values ​​in the formula above, we find that:

[tex]= (5)(0.9) + ( 20)(0.1)\\= 4.5 + 2\\= 6.5[/tex]

See more about efficiency at brainly.com/question/6672666

Write a method that draws a circle and a square that is centered in a DrawingPanel. The method will take in the width and height (they are the same for both the circle and square) and a Graphics object as parameters
IN java
current code: turn it into a method along with the main method
import java.awt.*;
public class Graphics {
static final int WIDTH = 300;
static final int HEIGHT = 200;
public static void drawGraphics () {
}
public static void main(String []args) {
DrawingPanel2 draw = new DrawingPanel2(WIDTH,HEIGHT); // Make a DrawginPanel2 of size 300 by 200.
Graphics2D g = draw.getGraphics(); // gets graphics from DrawingPanel so you can draw
g.setColor(Color.RED);
g.fillRect(45, 30, 200, 150);
g.setColor(Color.BLUE);
g.fillOval(70, 30, 150, 150);
}
}

Answers

Answer:

public static void drawGraphics (Graphics g, int width, int height) {

   int r = Math.round(width/2);

   int x = 45;

   int y = 30;

     g.setColor(Color.RED);

   g.fillRect(x, y, width, height);

   g.setColor(Color.BLUE);

   g.fillOval(Math.round(x/2), Math.round(y/2), r, r);

}

Explanation:

The Java method "drawGraphics" of the Graphics class accepts draws a square with the "fillRect()" method of the Graphics class object and at its center, a circular path is drawn as well.

what types of problems if no antivirus is not installed

Answers

If you meant what would happen if you don't install an antivirus software, trust me, you don't want to know. I'd definitely recommend either Webroot (I believe that's how it's spelled) or Mcafee.

Should video gaming be considered a school sport?

Answers

Answer:

I believe it should be in higher grades such as high school or college so people don't abuse it like little kids might.

Answer:

No because the defininition of sports is an activity involving physical exertion and Video games don't involve physical extertion.

Other Questions
What is the difference between an urban area and a rural area? Whats 5+5+5+5+5+5+5+5+5+5+5+5+10+10+10+10 ????? Help!!! Using your knowledge of the kinetic molecular theory, what can you conclude about the motion of gas molecules as the temperature decreases?The motion of the molecules decrease in speed.The motion of the molecules remains the same.The molecule first rapidly increases in speed, then decreases.The motion of the molecules increase in speed. What would y be? please show me how do to it also so I can understand. This image shows flashlight beams reflecting off a mirror fromdifferent angles. Based on the angles of reflection, choose all pairs oflight rays that correctly match incoming light beams with theirreflected light beams,Question 2. Based on the image and the angles of reflection shown witch statement is true.A) When a light ray strikes a mirror, it randomly scattered.B) light is absorbed by mirrors and reflected directly upwards.C) light travels in a straight line until lit strikes an object D) light is reflected back to its source when it strikes an object What houses the visceral organs What are the main economic resources of Ontario? there are 15 fruits in a bow 6 of them are apples. What percentage of the pieces of in the bowl are apples? which type of bacteria would most likely be killed when it comes in contact with an antibiotic?-3 pore bacterial cell-5 pore bacterial cell-7 pore bacterial cell -9 pore bacterial cell PLEASE HELP ME ILL GIVE BRAINLIEST I REALLY NEED HELP PLEASEE 3. Was the 1950's nostalgic? Does nostalgia play a role in the American experience throughout its history? The credit remaining on a phone card (in dollars) is a linear function of the total calling time made with the card (in minutes). The remaining credit after 24 minutes of calls is $21.64, and the remaining credit after 35 minutes of calls is $20.10. What is the remaining credit after 45 minutes of calls? Cynthia invests some money in a bank which pays5% compound interest per year.She wants it to be worth over 8000 at the end of 3 years.What is the smallest amount, to the nearest pound, she can invest? Now that you have worked through a lot of material that includes these basic patterns, and you have compared grammatically correct and incorrect sentences, write down what you think is a rule that could explain what makes a sentence grammatically correct or not. For example, you might write something like: "verbs always match nouns in number, and they usually come before the noun." In other words, make your best guess for the grammar rule that makes sense out of the pattern(s) you see in the phrases you have been working with. Review if you need to, and you might briefly check your hunches against the sentences you have been working with in this or previous modules. Keep in mind that what you're after is your hunch, not a grammar rule from a text book. Now check your hunch with the explanation of this principle in the following pattern.SHOPPING PART 2 If the elf ate 3 cookies, Santa ate 5 cookies and Rudolph ate 7 cookies, how many cookies did Donner, Dasher and Dancer each have Training meetings can be used to accomplish personal, professional, and organizational goals. Which best describesexample of a training meeting that will meet a personal goal?O A nurse attends a meeting to summarize the rotating work schedule of the nursing staff.O A doctor attends a meeting to exchange information on new medical procedures.O A pregnant woman attends a class on proper nutrition during pregnancy.A patient attends a meeting with a hospital administrator to discuss the care received while hospitalized. Which of the following statements is true? a)National government is supreme. b)Virginia government is supreme c)Local government is supreme. d)President is supreme in lawmaking. does anyone like sao or sword art online? You push a 40 kg sled with a force of 50 N. If the friction force opposing the sleds motion is 9 N, what is the acceleration of the sled? Show your work, If a cell normally has 32 chromosomes, what would be the results of going through mitosis?