In this first part of the News App, you will request data from the Top Stories...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
In this first part of the News App, you will request data from the Top Stories API. Some examples of API calls: https://api.nytimes.com/svc/topstories/v2/arts.json?api-key-yourkey https://api.nytimes.com/svc/topstories/v2/home.json?api-key-yourkey https://api.nytimes.com/svc/topstories/v2/science.json? api-key-yourkey https://api.nytimes.com/svc/topstories/v2/us.json?api-key-yourkey https://api.nytimes.com/svc/topstories/v2/world.json?api-key=yourkey Nonetheless, each API call shown above is for a specific topic, for example, arts, home, science, US, and world. For our News App, the user will select which topic they want to know more about using a selectbox . I will write the options as a list for you to save you some precious time: Vy ["arts", "automobiles", "books", "business", "fashion", "food", "health", "home", "insider", "magazine", "movies", "nyregion", "opinion", "politics", "realestate", "science", "sports", "sundayreview"," "technology", "theater", "t-magazine", "travel", "upshot", "us", "world"] Moreover, you need to replace the yourkey with the string that is in the api_key.json file. Divide the screen into 2 columns : the first column will contain some picker elements for the user to choose from, and the second column only displays the wordcloud. The users can choose: • the maximum number of words in the wordcloud (between 1 and 200) • the colors used for the words in the wordcloud • the background color of the wordcloud Below these two columns, you need to provide a checkbox that, if clicked, will display a plot of the frequency distribution. Ask the user how many words they want to see in the plot between 1 and 20. Then, provide the frequency distribution for the most common words used in the top stories for the topic selected by the user. Make sure you do not display punctuations and stopwords. Part B - Most Popular Articles In this second part of the News App, you will use another API, the Most Popular Articles API. Instead of asking the user for a topic, here, you will ask the user for their preferred set of articles: shared, emailed or viewed and for the period from when these articles were published, which are the last: 1 day, 7 days or 30 days. Some examples of API calls: https://api.nytimes.com/svc/mostpopular/v2/emailed/7.json? api-key-yourkey https://api.nytimes.com/svc/mostpopular/v2/shared/30.json?api-key=yourkey Again, each API call shown above is for a specific set of articles (emailed and shared) and period of time (7 and 30). These two values should be chosen by the user using a selectbox B.. Following the same process you did in Part A, generate the wordcloud with the customization features and the frequency distribution plot with the most common words. Additional Support To properly display the wordcloud, I recommend one of these different implementations: wordcloud = WordCloud(width=TODO, height=TODO, plt.axis("off") st.pyplot(fig) stopwords=stop_words, max_words=TODO, background_color=TODO, colormap=TODO). generate(TODO) fig, ax = plt. subplots() plt.imshow(wordcloud, interpolation='bilinear') Notice that the TODO keyword above is parts of the code that you need to work on, they will be variables or constant values that you create in your code. In this first part of the News App, you will request data from the Top Stories API. Some examples of API calls: https://api.nytimes.com/svc/topstories/v2/arts.json?api-key-yourkey https://api.nytimes.com/svc/topstories/v2/home.json?api-key-yourkey https://api.nytimes.com/svc/topstories/v2/science.json? api-key-yourkey https://api.nytimes.com/svc/topstories/v2/us.json?api-key-yourkey https://api.nytimes.com/svc/topstories/v2/world.json?api-key=yourkey Nonetheless, each API call shown above is for a specific topic, for example, arts, home, science, US, and world. For our News App, the user will select which topic they want to know more about using a selectbox . I will write the options as a list for you to save you some precious time: Vy ["arts", "automobiles", "books", "business", "fashion", "food", "health", "home", "insider", "magazine", "movies", "nyregion", "opinion", "politics", "realestate", "science", "sports", "sundayreview"," "technology", "theater", "t-magazine", "travel", "upshot", "us", "world"] Moreover, you need to replace the yourkey with the string that is in the api_key.json file. Divide the screen into 2 columns : the first column will contain some picker elements for the user to choose from, and the second column only displays the wordcloud. The users can choose: • the maximum number of words in the wordcloud (between 1 and 200) • the colors used for the words in the wordcloud • the background color of the wordcloud Below these two columns, you need to provide a checkbox that, if clicked, will display a plot of the frequency distribution. Ask the user how many words they want to see in the plot between 1 and 20. Then, provide the frequency distribution for the most common words used in the top stories for the topic selected by the user. Make sure you do not display punctuations and stopwords. Part B - Most Popular Articles In this second part of the News App, you will use another API, the Most Popular Articles API. Instead of asking the user for a topic, here, you will ask the user for their preferred set of articles: shared, emailed or viewed and for the period from when these articles were published, which are the last: 1 day, 7 days or 30 days. Some examples of API calls: https://api.nytimes.com/svc/mostpopular/v2/emailed/7.json? api-key-yourkey https://api.nytimes.com/svc/mostpopular/v2/shared/30.json?api-key=yourkey Again, each API call shown above is for a specific set of articles (emailed and shared) and period of time (7 and 30). These two values should be chosen by the user using a selectbox B.. Following the same process you did in Part A, generate the wordcloud with the customization features and the frequency distribution plot with the most common words. Additional Support To properly display the wordcloud, I recommend one of these different implementations: wordcloud = WordCloud(width=TODO, height=TODO, plt.axis("off") st.pyplot(fig) stopwords=stop_words, max_words=TODO, background_color=TODO, colormap=TODO). generate(TODO) fig, ax = plt. subplots() plt.imshow(wordcloud, interpolation='bilinear') Notice that the TODO keyword above is parts of the code that you need to work on, they will be variables or constant values that you create in your code.
Expert Answer:
Related Book For
Management Accounting Information for Decision-Making and Strategy Execution
ISBN: 978-0137024971
6th Edition
Authors: Anthony A. Atkinson, Robert S. Kaplan, Ella Mae Matsumura, S. Mark Young
Posted Date:
Students also viewed these programming questions
-
Consider the optimal control problem OCP for dx(t) S: == Ax(t) + Bu(t), dt r(0) = 20+ y(t) =Cx(t) y RP,ER", uER, 0
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Case Study: Quick Fix Dental Practice Technology requirements Application must be built using Visual Studio 2019 or Visual Studio 2017, professional or enterprise. The community edition is not...
-
XYZ Corporation is considering two mutually exclusive projects that require a $150,000 investment each. Project A has an expected life of 6 years and will generate net cash flows of $35,000 per year....
-
For each of the following agents, develop a PEAS description of the task environment: a. Robot soccer player, b. Internet book-shopping agent; c. Autonomous Mars rover; d. Mathematicians...
-
Presented here are summarized data from the balance sheets and income statements of Wiper. Inc.: Required: a. Calculate return on investment, based on net income and average total assets, for 2017...
-
If you drop a book from a certain height, it falls (accelerating all the while) because of the gravitational force exerted by Earth on it. Because forces always come in interaction pairs, the book...
-
Updike Upholstery cuts and sews fabric for custom ordered chairs, ottomans, and sofas. Often, the more complicated patterns are for the smaller pieces, where cutting is more time consuming than...
-
Question 2 Abantu Ltd, a textile manufacturing company in Bungoma, recently introduced a compensation programme for its employees. As a human resource specialist, explain what prompted the firm to...
-
On 1 October 2023 Pumice acquired the following non-current investments: (i) 80% of the equity share capital of Silverton at a cost of 13. 6 million (ii) 50% of Silverton's 10% loan notes at par...
-
In this problem, you may find it useful to recall the following fact about Poisson random variables. Let X and Y be two independent Poisson random variables, with means ? 1 and ?2, respectively....
-
Depot Logistics Inc. has declared pretax income from its operations for the year of $560,000. In addition, it also received interest payment of $40,000 on bond stock held in Warehouse PLC. During the...
-
Assume that the rate of inflation expected over the coming financial year in India is 6.5%. Explain how a 1-year T-bill could earn a negative real rate of return over the next year. How could it have...
-
Volkswagen AG (VW) uses a maximum payback period of 4 years and currently must choose between two mutually exclusive electric car projects. Project Crozz requires an initial outlay of 25,000,000;...
-
Hoffmann-La Roche is considering purchasing a capsule counting and packing machine for 5,500,000 and incurs an additional 130,000 in installation expenses. It is replacing older machines that can be...
-
Parsons Electronics Inc. ended 2017 with a net profit before taxes of 560,000. The company is subject to a 20% tax rate and must pay 50,000 in preferred stock dividends. The balance sheet shows...
-
Question 2 Ruby is a sophisticated present-biased agent with 3 = 0.5 and 6 = 1. She has utility function u(x) = x. Ruby is deciding today (t = 0) whether she will either: work tomorrow (t 1) for $10...
-
Derive Eq. (18.33) from Eq. (18.32).
-
What are the two general methods of information gathering and sharing when undertaking a benchmarking exercise?
-
Financial budgets Many managers consider the pro forma financial statements to be the most important product of the master budgeting process. Why do you think they believe this?
-
The Brinker Company uses a job order costing system at its local plant. The plant has a machining department and a finishing department. The company uses machine hours to allocate machining...
-
a. Show that the mean-squared forecast error \(E\left[\left(\hat{y}_{T+1}-y_{T+1} ight)^{2} \mid I_{T} ight]\) for a forecast \(\hat{y}_{T+1}\), that depends only on past information \(I_{T}\), can...
-
Consider the AR(1) model \(y_{t}=\delta+\theta y_{t-1}+e_{t}\) where \(|\theta|)=0\) and \(\operatorname{var}\left(e_{t} \mid I_{t-1} ight)=\sigma^{2}\). Let \(\bar{y}_{-1}=\sum_{t=2}^{T} y_{t}...
-
Consider a stationary model that combines the \(\operatorname{AR}(2)\) model \(y_{t}=\delta+\theta_{1} y_{t-1}+\theta_{2} y_{t-2}+e_{t}\) with an \(\mathrm{AR}(1)\) error model \(e_{t}=ho...
Study smarter with the SolutionInn App