Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In Python Hint: 1) create documents and save them in a location. 2) define a list, e.g., prob43 = [doc1.text, doc2.text, doc3.text, doc4.text, doc5.text, doc6.text
In Python
Hint: 1) create documents and save them in a location. 2) define a list, e.g., prob43 = ["doc1.text", "doc2.text", "doc3.text", "doc4.text", "doc5.text", "doc6.text" ] 3) define functions, e.g., readFile(): createMapo, returning {"doc1': ['word?', 'word2', ...), ...}; buildMapo, returning {'doc1': {'word1: 2, 'word2": 1, ...}, ...}; reduce(), returning 'word1": {doc1:2, 'doc2": 1, ...}, 'word2": {'doc1': 1, ...}, ...} 4) use sort() function for a list Problem 4.3 Consider the six documents appearing in the following image. Assume that the text in each box is a document. Realizing a carbon-free future Cleaner data centers, batteries included A podcast about the unseen world of data A centers 2020 2020 We're installing the first battery aged system to replace generators at a typerscale data carter. The system will help keep our users' searches, emails and videos on the move without the pollution associated with burning diesel, while also being available as an ages that strengthens the electric grid Where the Internet Lives is a six-episode podcast about the fascinating world of data centers. Join us as we venture into places that very few people ever See firsthand - and learn about the technology people, and places that make the internet run Listen Here 2020 We are the first major company to make a commitment to operate on 24/7 carbon-free energy in all our data centers and campuses worldwide- and were working to get it done by 2030. Learn from CEO Sundar Pichai about our continued commitment to go caroon-free. Doc1 Doc2 Doc3 Inside a Google data center Data centers are more officient than ever 2020 Ride along on a tour of a Google data center, listen in on a chat with vice president Joe Kava, and learn about the six layers of physical seounty that help keep user data safe and secure Our data centers now work harder when the sun shines and the wind blows 2020 A new advancement in our quest for 24/7 carbon- free energy is a carbon intelligent computing platform. This first-of-its kind system for our hyperscale data centers shifts the timing of flexible compute tasks to align with times when low- carbon power sources are most plentiful 2020 Even as demand for cloud computing has skyrocketed, energy efficiency improvements have kept electricity usage almost fat across the globe's data centers. How are we squeezing more workout of every electron? The answer comes down to our telenities quest to eliminate enerely wasle in all of cur operations Doc4 Doc5 Doch Write a Python code that can produce the following: (a) Read each document and assign the list of words to the document name. For example, [['docl': ''Cleaner', 'data', 'centers,', 'batteries', 'included', '2020', ..., 117 Python for Data Sciences integration with Excel and with R. 'grid.']), ('doc2': ('A', 'podcast', 'about', 'the', 1), ..., 'doc6': ['Data', 'centers', , 'operations.'])] (b) Map. Map produces a dictionary that contains the six documents. For example, I'docl': i'cleaner': 1, 'data': 2, centers,': 1, ..., 'grid.': 1), 'doc2': {'a': 1, 'podcast': 2, "about': 3, 'the': 5, 'unseen': 1, ..., ... 'doc6': {'Data': 1, 'centers': 1, 'are': 2, 'more': 2, ...) (c) MapReduce. For example, the final output will be {'Cleaner': {'docl': 1), 'data': {"docl': 2, "doc2": 2, "doc3': 1, "doc4": 3, "doc5': 2, "doc6': 1), 'centers,': I'docl': 1), 'batteries': {'doci': 1), 'included': ('docl': 1), 2020': {'doci': 1, 'doc2': 1, "doc3': 1, "doc4': 1, 'doc5': 1, 'doc6': 1), ... 'eliminate': { 'doc6': 1), 'waste': {'doc6': 1), operations.': {'doc6': 1}} (d) List the words by sorting the outcome of MapReduce. It should list as follows: 1) 2020 => ''doci': 1, doc2": 1, 'doc3': 1, doct': 1, 'docb': 1, "doc': 1) 2) 2030. -> ('doc3': il 3) 24/7 => I'doc3': 1, 'doc5': 1) 4) A => ('doc2': 1, "doc5': 1) 5) CEO -> ('doc3': 1) 6) Cleaner -> {'docl': 1) 192) working -> ('doc3': 1) 193) world -> I'doc2': 2) 194) worldwide -> I'doc3': 1) 195) ae" =>('docl': 1, "doc2': 1, "doc3': 1 Hint: 1) create documents and save them in a location. 2) define a list, e.g., prob43 = ["doc1.text", "doc2.text", "doc3.text", "doc4.text", "doc5.text", "doc6.text" ] 3) define functions, e.g., readFile(): createMapo, returning {"doc1': ['word?', 'word2', ...), ...}; buildMapo, returning {'doc1': {'word1: 2, 'word2": 1, ...}, ...}; reduce(), returning 'word1": {doc1:2, 'doc2": 1, ...}, 'word2": {'doc1': 1, ...}, ...} 4) use sort() function for a list Problem 4.3 Consider the six documents appearing in the following image. Assume that the text in each box is a document. Realizing a carbon-free future Cleaner data centers, batteries included A podcast about the unseen world of data A centers 2020 2020 We're installing the first battery aged system to replace generators at a typerscale data carter. The system will help keep our users' searches, emails and videos on the move without the pollution associated with burning diesel, while also being available as an ages that strengthens the electric grid Where the Internet Lives is a six-episode podcast about the fascinating world of data centers. Join us as we venture into places that very few people ever See firsthand - and learn about the technology people, and places that make the internet run Listen Here 2020 We are the first major company to make a commitment to operate on 24/7 carbon-free energy in all our data centers and campuses worldwide- and were working to get it done by 2030. Learn from CEO Sundar Pichai about our continued commitment to go caroon-free. Doc1 Doc2 Doc3 Inside a Google data center Data centers are more officient than ever 2020 Ride along on a tour of a Google data center, listen in on a chat with vice president Joe Kava, and learn about the six layers of physical seounty that help keep user data safe and secure Our data centers now work harder when the sun shines and the wind blows 2020 A new advancement in our quest for 24/7 carbon- free energy is a carbon intelligent computing platform. This first-of-its kind system for our hyperscale data centers shifts the timing of flexible compute tasks to align with times when low- carbon power sources are most plentiful 2020 Even as demand for cloud computing has skyrocketed, energy efficiency improvements have kept electricity usage almost fat across the globe's data centers. How are we squeezing more workout of every electron? The answer comes down to our telenities quest to eliminate enerely wasle in all of cur operations Doc4 Doc5 Doch Write a Python code that can produce the following: (a) Read each document and assign the list of words to the document name. For example, [['docl': ''Cleaner', 'data', 'centers,', 'batteries', 'included', '2020', ..., 117 Python for Data Sciences integration with Excel and with R. 'grid.']), ('doc2': ('A', 'podcast', 'about', 'the', 1), ..., 'doc6': ['Data', 'centers', , 'operations.'])] (b) Map. Map produces a dictionary that contains the six documents. For example, I'docl': i'cleaner': 1, 'data': 2, centers,': 1, ..., 'grid.': 1), 'doc2': {'a': 1, 'podcast': 2, "about': 3, 'the': 5, 'unseen': 1, ..., ... 'doc6': {'Data': 1, 'centers': 1, 'are': 2, 'more': 2, ...) (c) MapReduce. For example, the final output will be {'Cleaner': {'docl': 1), 'data': {"docl': 2, "doc2": 2, "doc3': 1, "doc4": 3, "doc5': 2, "doc6': 1), 'centers,': I'docl': 1), 'batteries': {'doci': 1), 'included': ('docl': 1), 2020': {'doci': 1, 'doc2': 1, "doc3': 1, "doc4': 1, 'doc5': 1, 'doc6': 1), ... 'eliminate': { 'doc6': 1), 'waste': {'doc6': 1), operations.': {'doc6': 1}} (d) List the words by sorting the outcome of MapReduce. It should list as follows: 1) 2020 => ''doci': 1, doc2": 1, 'doc3': 1, doct': 1, 'docb': 1, "doc': 1) 2) 2030. -> ('doc3': il 3) 24/7 => I'doc3': 1, 'doc5': 1) 4) A => ('doc2': 1, "doc5': 1) 5) CEO -> ('doc3': 1) 6) Cleaner -> {'docl': 1) 192) working -> ('doc3': 1) 193) world -> I'doc2': 2) 194) worldwide -> I'doc3': 1) 195) ae" =>('docl': 1, "doc2': 1, "doc3': 1Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started