99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

合肥生活安徽新聞合肥交通合肥房產生活服務合肥教育合肥招聘合肥旅游文化藝術合肥美食合肥地圖合肥社保合肥醫院企業服務合肥法律

代寫INFS3208、代做Python語言編程
代寫INFS3208、代做Python語言編程

時間:2024-10-11  來源:合肥網hfw.cc  作者:hfw.cc 我要糾錯



School of Information Technology and Electrical Engineering 
INFS**08 – Cloud Computing 
Programming Assignment Task III (10 Marks) 
Task description: 
In this assignment, you are asked to write a piece of Spark code to count occurrences of verbs in the 
UN debates and find the most similar debate contents. The returned result should be the top 10 
verbs that are most frequently used in all debates and the debate that is most similar to the one 
we provide. This assignment is to test your ability to use transformation and action operations in Spark 
RDD programming and your understanding of Vector Database. You will be given three files, 
including a UN General Debates dataset (un-general-debates.csv), a verb list (all_verbs.txt) 
and a verb dictionary file (verb_dict.txt). These source files are expected to be stored in a HDFS. 
You can choose either Scala or Python to complete this assignment in the Jupyter Notebook. There are 
some technical requirements in your code submission as follows: 
 
Objectives: 
1. Read Source Files from HDFS and Create RDDs (1.5 marks): 
• Read the UN General Debates dataset (un-general-debates.csv) from HDFS and 
convert only the “text” column into an RDD. Details of un-general-debates.csv are 
provided in the Preparation section below (1 mark). 
• Read the verb list file (all_verbs.txt) and verb dictionary file (verb_dict.txt) from 
HDFS and load them into separate RDDs (0.5 marks). 
• Note: If you failed to read files from HDFS, you can still read them from the local file 
system in work/nbs/ and complete the following tasks. 
2. Use Learned RDD Operations to Preprocess the Debate Texts (3 marks): 
• Remove empty lines (0.5 marks). 
• Remove punctuations that could attach to the verbs (0.5 marks). 
o E.g., “work,” and “work” will be counted differently, if you DO NOT remove the 
punctuation. 
• Change the capitalization or case of text (0.5 marks). 
o E.g., “WORK”, “Work” and “work” will be counted as three different verbs, if you 
DO NOT make all of them in lower-case. 
• Find all verbs in the RDD by matching the words in the given verb list (all_verbs.txt) 
(0.5 mark). 
• Convert all verbs in different tenses into the simple present tense by looking up the 
verbs in the verb dictionary list (verb_dict.txt) (1 mark). 
o E.g., regular verb: “work” - works”, “worked”, and “working”. 
o E.g., irregular verb: “begin” - “begins”, “began”, and “begun”. o E.g., linking verb “be” and its various forms, including “is”, “am”, “are”, “was”, 
“were”, “being” and “been”. 
o E.g., (work, 100), (works,50), (working,150) should be counted as (work, 300). 
3. Use learned RDD Operations to Count Verb Frequency (3 marks): 
• Count the top 10 frequently used verbs in UN debates (2 marks). 
• Display the results in the format (“verb1”, count1), (“verb2”, count2), … and in a 
descending order of the counts (1 marks). 
4. Use Vector Database (Faiss) to Find the Most Similar Debate (2.5 marks): 
• Convert the original debates into vectors and store them in a proper Index (1.5 mark). 
• Search the debate content that has the most similar idea to “Global climate change is 
both a serious threat to our planet and survival.” (1 mark) 
 
 
Preparation: 
In this individual coding assignment, you will apply your knowledge of Vector Database, Spark, Spark 
RDD Programming and HDFS (in Lectures 7-10). Firstly, you should read Task Description to 
understand what the task is and what the technical requirements include. Secondly, you should review 
the creation and usage of Faiss, transformations and actions in Spark, and usage of HDFS in Lectures 
and Practicals 7-10. In the Appendix, there are some transformation and action operations you could 
use in this assignment. Lastly, you need to write the code (Scala or Python) in the Jupyter Notebook. 
All technical requirements need to be fully met to achieve full marks. You can either practise on 
the GCP’s VM or your local machine with Oracle Virtualbox if you are unable to access GCP. Please 
read the Example of writing Spark code below to have more details. 
 
 
Assignment Submission: 
 You need to compress only the Jupyter Notebook (.ipynb) file. 
 The name of the compressed file should be named “FirstName_LastName_StudentNo.zip”. 
 You must make an online submission to Blackboard before 3:00 PM on Friday, 11/10/2024 
 Only one extension application could be approved due to medical conditions. 
 
 
Main Steps: 
Step 1: 
Log in your VM instance and change to your home directory. We recommend using a VM instance 
with at least 4 vCPUs, 8G memory and 20GB free disk space. 
 
Step 2: 
git clone https://github.com/csenw/cca3.git && cd cca3 
Run these commands to download the required docker-compose.yml file and configuration files. Step 3: 
sudo chmod -R 777 nbs/ 
docker-compose up -d 
Run all the containers using docker-compose 
 
 
 
Step 4: 
Open the Jupyter Notebook (http://external_IP:8888) and you can find all the files under the 
work/nbs/ folder. This is also the folder where you should write the notebook (.ipynb) file. 
 
 Step 5: 
docker ps 
docker exec <container_id> hdfs dfs -put /home/nbs/all_verbs.txt /all_verbs.txt 
docker exec <container_id> hdfs dfs -put /home/nbs/verb_dict.txt /verb_dict.txt 
docker exec <container_id> hdfs dfs -put /home/nbs/un-general-debates.csv /ungeneral-debates.csv

Run the above commands to put the three source files into HDFS. Substitute <container_id> with 
your namenode container ID. After that, you should see the three files from HDFS web interface at 
http://external_IP/explorer.html 
 
 
Step 6: 
The un-general-debates.csv is a dataset that includes the text of each country’s statement from 
the general debate, separated by “country”, “session”, “year” and “text”. This dataset includes over 
forty years of data from different countries, which allows for the exploration of differences between 
countries and over time [1,2]. It is organized in the following format: 
 
In this assignment, we only consider the “text” column. 
The verb_dict.txt file contains different tenses of each verb, separated by commas. The first word 
is the simple present tense of the verb. 
 The all_verbs.txt file contains all the verbs. 
 
 
Step 7: 
Create a Jupyter Notebook to complete the programming objectives. 
We provide some intermediate output samples below. Please note that these outputs are NOT answers 
and may vary from your outputs due to different implementations and different Spark behaviours. 
• Intermediate output sample 1, take only verbs: 
 
 
• Intermediate output sample 2, top 10 verb counts (without converting verb tenses): 
 
 • Intermediate output sample 3, most similar debate: 
 
You are free to use your own implementation. However, your result should reasonably reflect the top 
10 verbs that are most frequently used in UN debates, and the most similar debate contents to the 
sentence “Global climate change is both a serious threat to our planet and survival.” 
 
 
Reference: 
[1] UN General Debates, https://www.kaggle.com/datasets/unitednations/un-general-debates. 
[2] Alexander Baturo, Niheer Dasandi, and Slava Mikhaylov, "Understanding State Preferences With 
Text As Data: Introducing the UN General Debate Corpus". Research & Politics, 2017. 
 
 Appendix: 
Transformations: 
Transformation Meaning 
map(func) Return a new distributed dataset formed by passing each element of the 
source through a function func. 
filter(func) Return a new dataset formed by selecting those elements of the source on 
which funcreturns true. 
flatMap(func) Similar to map, but each input item can be mapped to 0 or more output 
items (so funcshould return a Seq rather than a single item). 
union(otherDataset) Return a new dataset that contains the union of the elements in the source 
dataset and the argument. 
intersection(otherDataset) Return a new RDD that contains the intersection of elements in the source 
dataset and the argument. 
distinct([numPartitions])) Return a new dataset that contains the distinct elements of the source 
dataset. 
groupByKey([numPartitions]) When called on a dataset of (K, V) pairs, returns a dataset of (K, 
Iterable<V>) pairs. 
Note: If you are grouping in order to perform an aggregation (such as a 
sum or average) over each key, using reduceByKey or aggregateByKey will 
yield much better performance. 
Note: By default, the level of parallelism in the output depends on the 
number of partitions of the parent RDD. You can pass an 
optional numPartitions argument to set a different number of tasks. 
reduceByKey(func, 
[numPartitions]) 
When called on a dataset of (K, V) pairs, returns a dataset of (K, V) pairs 
where the values for each key are aggregated using the given reduce 
function func, which must be of type (V,V) => V. Like in groupByKey, the 
number of reduce tasks is configurable through an optional second 
argument. 
sortByKey([ascending], 
[numPartitions]) 
When called on a dataset of (K, V) pairs where K implements Ordered, 
returns a dataset of (K, V) pairs sorted by keys in ascending or descending 
order, as specified in the boolean ascending argument. 
join(otherDataset, 
[numPartitions]) 
When called on datasets of type (K, V) and (K, W), returns a dataset of (K, 
(V, W)) pairs with all pairs of elements for each key. Outer joins are 
supported through leftOuterJoin, rightOuterJoin, and fullOuterJoin. 
 
 Actions: 
Action Meaning 
reduce(func) Aggregate the elements of the dataset using a function func (which takes 
two arguments and returns one). The function should be commutative 
and associative so that it can be computed correctly in parallel. 
collect() Return all the elements of the dataset as an array at the driver program. 
This is usually useful after a filter or other operation that returns a 
sufficiently small subset of the data. 
count() Return the number of elements in the dataset. 
first() Return the first element of the dataset (similar to take(1)). 
take(n) Return an array with the first n elements of the dataset. 
countByKey() Only available on RDDs of type (K, V). Returns a hashmap of (K, Int) pairs 
with the count of each key. 
foreach(func) Run a function func on each element of the dataset. This is usually done 
for side effects such as updating an Accumulator or interacting with 
external storage systems. 
Note: modifying variables other than Accumulators outside of 
the foreach() may result in undefined behavior. See Understanding 
closures for more details. 
 
請加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp




 

掃一掃在手機打開當前頁
  • 上一篇:代寫comp2022、代做c/c++,Python程序設計
  • 下一篇:代做320SC編程、代寫Python設計程序
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    出評 開團工具
    出評 開團工具
    挖掘機濾芯提升發動機性能
    挖掘機濾芯提升發動機性能
    海信羅馬假日洗衣機亮相AWE  復古美學與現代科技完美結合
    海信羅馬假日洗衣機亮相AWE 復古美學與現代
    合肥機場巴士4號線
    合肥機場巴士4號線
    合肥機場巴士3號線
    合肥機場巴士3號線
    合肥機場巴士2號線
    合肥機場巴士2號線
    合肥機場巴士1號線
    合肥機場巴士1號線
  • 短信驗證碼 豆包 幣安下載 AI生圖 目錄網

    關于我們 | 打賞支持 | 廣告服務 | 聯系我們 | 網站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

          9000px;">

                亚洲国产一区二区三区 | 国产精品久久久久久久久晋中| 欧美日韩一二三区| 91美女福利视频| 成人av网址在线| 国产91丝袜在线播放| 国产精品自拍毛片| 国产乱码字幕精品高清av | 欧美日韩国产片| 制服丝袜国产精品| 欧美一区二区福利在线| 精品不卡在线视频| 欧美激情中文不卡| 亚洲欧洲另类国产综合| 亚洲激情在线激情| 日韩一区精品字幕| 日韩精品欧美精品| 紧缚捆绑精品一区二区| 国产成人亚洲精品狼色在线| 成人视屏免费看| 色悠悠亚洲一区二区| 欧美日韩精品福利| 久久亚区不卡日本| 国产精品看片你懂得| 亚洲影院免费观看| 捆绑变态av一区二区三区| 久久99精品国产麻豆婷婷| 成人久久视频在线观看| 欧美视频在线不卡| 久久综合精品国产一区二区三区| 欧美精品一区二区三区在线播放 | 欧美精品123区| 日韩精品一区二区三区视频播放 | 欧美专区在线观看一区| **网站欧美大片在线观看| 91亚洲午夜精品久久久久久| 国产精品视频线看| 日本大香伊一区二区三区| 精品在线一区二区| 日本一区二区高清| 欧美午夜片在线观看| 色综合天天在线| 欧美三级韩国三级日本一级| 成人国产在线观看| 精品视频全国免费看| 久久毛片高清国产| 丝袜美腿亚洲一区二区图片| 国产欧美日韩激情| 欧美老肥妇做.爰bbww| 不卡一二三区首页| 精品亚洲aⅴ乱码一区二区三区| 亚洲欧美日韩国产综合在线| 日韩视频免费观看高清完整版| 91在线观看视频| 99re这里只有精品首页| 美女视频黄a大片欧美| 一区二区三区在线视频免费观看| 国产欧美日韩三区| 国产午夜亚洲精品羞羞网站| 日韩精品在线看片z| 亚洲乱码日产精品bd| 欧美岛国在线观看| 日韩天堂在线观看| 91蜜桃视频在线| 日韩成人免费电影| 免费在线成人网| 国产精品99久久久| 亚洲欧美在线另类| 日本vs亚洲vs韩国一区三区| 在线视频亚洲一区| 日韩一级二级三级精品视频| 一区二区三区中文在线观看| 国产999精品久久久久久| 日韩欧美电影一区| 亚洲大片一区二区三区| 日韩区在线观看| 国产福利精品一区| 99re亚洲国产精品| 欧美日韩在线直播| 日韩欧美一级二级三级久久久| 一本大道久久a久久综合| 国产91丝袜在线18| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | av电影一区二区| 亚洲成a人片在线观看中文| 色综合天天性综合| 国产精品夫妻自拍| 成人v精品蜜桃久久一区| 久久久噜噜噜久久人人看| 国产乱人伦偷精品视频免下载| 久久亚区不卡日本| 国产精品18久久久久| 国产精品视频九色porn| 99国产精品国产精品毛片| 国产精品乱码人人做人人爱| 成人免费观看视频| 一区二区日韩av| 欧美精品一卡两卡| 久久精品国产亚洲aⅴ| 久久青草欧美一区二区三区| 成人视屏免费看| 亚洲国产一区视频| 日韩欧美一区中文| 国产乱码精品1区2区3区| 国产欧美一区二区精品秋霞影院| av成人免费在线| 亚洲va欧美va人人爽| 555www色欧美视频| 国产成人啪午夜精品网站男同| 国产精品福利在线播放| 欧美在线一区二区三区| 青青国产91久久久久久| 久久精品亚洲一区二区三区浴池 | 精品国产三级a在线观看| 顶级嫩模精品视频在线看| 亚洲一区二区三区小说| 精品三级av在线| 99久久99久久久精品齐齐| 五月婷婷激情综合网| 久久嫩草精品久久久精品| 色悠悠亚洲一区二区| 免费成人美女在线观看.| 欧美日韩一区三区| 777欧美精品| 国产一区二区三区黄视频 | 蜜桃视频一区二区| 色琪琪一区二区三区亚洲区| 图片区小说区区亚洲影院| 欧美日韩一二区| 国产aⅴ综合色| 日本免费在线视频不卡一不卡二| 欧美日韩国产一二三| 国产美女精品一区二区三区| 亚洲美女视频在线| 欧美一卡二卡在线| 欧美aaaaaa午夜精品| 成人欧美一区二区三区1314| 日韩一区二区在线观看视频| 精品一区二区精品| 国产嫩草影院久久久久| 国产乱人伦偷精品视频免下载| 777午夜精品视频在线播放| 另类欧美日韩国产在线| 亚洲三级免费观看| 亚洲女人小视频在线观看| 精品一区精品二区高清| 欧美色偷偷大香| 免费黄网站欧美| 7799精品视频| 91麻豆国产在线观看| 国产精品亚洲第一| 蜜臀精品一区二区三区在线观看| 亚洲在线视频网站| 玉米视频成人免费看| 中文字幕在线免费不卡| 精品播放一区二区| 欧美一区二区在线看| 日韩毛片一二三区| 色先锋aa成人| 国产一区二区三区免费播放| 国产一区二区三区精品欧美日韩一区二区三区 | 日本成人在线看| 欧美aaa在线| 国产色婷婷亚洲99精品小说| 欧美a一区二区| 91麻豆精品国产91久久久使用方法| 国产精品久久久久久一区二区三区| 欧美一级免费观看| 日韩欧美在线123| 欧美成人福利视频| 日韩欧美不卡在线观看视频| 欧美日韩一级黄| 欧美精品123区| 精品国产伦一区二区三区观看方式| 日韩精品一区在线观看| 国产三区在线成人av| 国产情人综合久久777777| 国产精品久久久久久久久动漫| 国产精品久久久久久久久免费桃花| 国产精品久久二区二区| 一区二区三区四区国产精品| 亚洲电影一级片| 经典三级一区二区| 成人久久视频在线观看| 日本韩国欧美三级| 宅男在线国产精品| 国产网站一区二区三区| 夜夜亚洲天天久久| 美国一区二区三区在线播放| 国产福利一区二区三区视频在线| bt欧美亚洲午夜电影天堂| 欧美午夜不卡视频| 精品播放一区二区| 亚洲免费观看视频| 日本不卡一二三区黄网| 国产在线一区观看| 一本到一区二区三区| 日韩欧美卡一卡二| 亚洲精品国产精品乱码不99| 麻豆成人久久精品二区三区小说|