[Solved]Python 3 Help Please Answer Question Answer Parts One Question Multiple Parts Cannot Break Q37080246
Python 3 Help:
Please only answer the question if you can answer all parts. Itis one question but with multiple parts and I cannot break it down.Please provide pictures of code too copy for spacing purposes. Ihave provided google doc of the research-papers.txt file that Ihave:
https://docs.google.com/document/d/1UlFUN-lU1EjI01PLTyyVk-kkv225ZWkxEhFiZ8fRhQM/edit?usp=sharing
Make a dictionary that maps each term in the papertitles to a list of papers whose titles contain that term(identified by the paper ID).
Requirements: Name your dictionaryterm_index
I have done that:
term_index = dict()
for each_id in paper_titles:
title = paper_titles[each_id]
for each_term in title.split(‘ ‘):
if each_term in term_index:
term_index[each_term].append(each_id)
else:
term_index[each_term] = [each_id]
print(term_index)
Although I am not good with search engines:
Write a program that can search the papers dataset basedon terms in the title. Use the dictionary above
First Write a search function

Then: Write a program that uses the searchfunction
Then Index the papers so thatwe can search for papers by author.
You should have a dictionary that has authors as keysand lists of paper IDs as values.
Requirements: Name your function search_papers () Your function should return a list of matching papers with 0 items in it) . Your function should take 2 parameters: 1) the query term to search for, and 2) your term_index from Question 3 . Your function should not fail if the user enters a term that isn’t in the term_index: in that situation, your function should return an empty list (.e.,a list # Define your function here Print a message that tells the user how many results were found (hint:you can compute this by getting the length of the list of results, if your function was defined correctly) If there are matching papers, print out each matching paper ID, along with its paper title (retrieved from the paper-titles dictionary from Question 2) · Here is an example of an input/output trace from a function and program that meets these requirements: What do you want to search for? data There are 9 papers that match your search. 1960191312 empirical analysis of data breach litigation 2364071307 learning individual behavior using sensor data the case of gps traces and taxi drivers 2529452593 modeling user engagement in mobile content consumption with tapstream data and field experiment 2338895451 understanding user economic behavior in the city using large scale geotagged and crowdsourced data 2273081434 gaussian processes for independence tests with non iid data in causal inference 2601121662 graph structure learning from unlabeled data for early outbreak detection 2575532943 graph structure learning from unlabeled data for event detection 1961666882 identifying emerging novel outbreaks in textual emergency department data 2243328796 predicting bundles of spatial locations from learning revealed preference data Here is another example trace for a situation where the user’s term isn’t in the dictionary: What do you want to search for? mouse There are 0 papers that match your search. query-input(“What do you want to search for?”) results search papers(_. # Write the rest of your code here for the program here Show transcribed image text Requirements: Name your function search_papers () Your function should return a list of matching papers with 0 items in it) . Your function should take 2 parameters: 1) the query term to search for, and 2) your term_index from Question 3 . Your function should not fail if the user enters a term that isn’t in the term_index: in that situation, your function should return an empty list (.e.,a list # Define your function here
Print a message that tells the user how many results were found (hint:you can compute this by getting the length of the list of results, if your function was defined correctly) If there are matching papers, print out each matching paper ID, along with its paper title (retrieved from the paper-titles dictionary from Question 2) · Here is an example of an input/output trace from a function and program that meets these requirements: What do you want to search for? data There are 9 papers that match your search. 1960191312 empirical analysis of data breach litigation 2364071307 learning individual behavior using sensor data the case of gps traces and taxi drivers 2529452593 modeling user engagement in mobile content consumption with tapstream data and field experiment 2338895451 understanding user economic behavior in the city using large scale geotagged and crowdsourced data 2273081434 gaussian processes for independence tests with non iid data in causal inference 2601121662 graph structure learning from unlabeled data for early outbreak detection 2575532943 graph structure learning from unlabeled data for event detection 1961666882 identifying emerging novel outbreaks in textual emergency department data 2243328796 predicting bundles of spatial locations from learning revealed preference data Here is another example trace for a situation where the user’s term isn’t in the dictionary: What do you want to search for? mouse There are 0 papers that match your search. query-input(“What do you want to search for?”) results search papers(_. # Write the rest of your code here for the program here
Expert Answer
Answer to Python 3 Help: Please only answer the question if you can answer all parts. It is one question but with multiple parts a… . . .
OR

