国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看

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

代寫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設計程序
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    流體仿真外包多少錢_專業CFD分析代做_友商科技CAE仿真
    流體仿真外包多少錢_專業CFD分析代做_友商科
    CAE仿真分析代做公司 CFD流體仿真服務 管路流場仿真外包
    CAE仿真分析代做公司 CFD流體仿真服務 管路
    流體CFD仿真分析_代做咨詢服務_Fluent 仿真技術服務
    流體CFD仿真分析_代做咨詢服務_Fluent 仿真
    結構仿真分析服務_CAE代做咨詢外包_剛強度疲勞振動
    結構仿真分析服務_CAE代做咨詢外包_剛強度疲
    流體cfd仿真分析服務 7類仿真分析代做服務40個行業
    流體cfd仿真分析服務 7類仿真分析代做服務4
    超全面的拼多多電商運營技巧,多多開團助手,多多出評軟件徽y1698861
    超全面的拼多多電商運營技巧,多多開團助手
    CAE有限元仿真分析團隊,2026仿真代做咨詢服務平臺
    CAE有限元仿真分析團隊,2026仿真代做咨詢服
    釘釘簽到打卡位置修改神器,2026怎么修改定位在范圍內
    釘釘簽到打卡位置修改神器,2026怎么修改定
  • 短信驗證碼 寵物飼養 十大衛浴品牌排行 suno 豆包網頁版入口 wps 目錄網 排行網

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

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

    国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看
    日韩资源av在线| 国产天堂在线播放| 国产精品久久久久av免费| 久久久久久久9| 日韩在线国产精品| 久久99蜜桃综合影院免费观看| av动漫免费看| 91九色在线视频| 久久精品午夜福利| 久久久久福利视频| 国产成人一区二区在线| 国产极品美女高潮无套久久久| 国产男女激情视频| 国产在线精品自拍| 国产精品专区一| 久久免费精品日本久久中文字幕| 久久久久久久久久久久久久一区| 久久精品久久久久| 欧美激情一二三| 日本一区二区三区视频免费看 | 国产专区欧美专区| 国产伦精品一区| 国产白丝袜美女久久久久| 国产精品日本一区二区| 亚洲一区二区三区午夜| 青草网在线观看| 国语自产精品视频在免费| 国产精品免费一区二区三区| 亚洲在线视频一区二区| 欧美日韩一区二区三区免费| 国产伦精品一区二区三区四区视频_ | 男女视频网站在线观看| 97精品国产97久久久久久粉红| 久久9精品区-无套内射无码| 欧美激情中文字幕乱码免费| 亚洲国产日韩美| 国产一区高清视频| 色噜噜国产精品视频一区二区 | 日韩av电影在线网| 国内精品久久久久| 国产av人人夜夜澡人人爽麻豆| 欧美成年人在线观看| 欧美在线国产精品| 久久精品国产理论片免费| 中文字幕不卡每日更新1区2区| 欧美h视频在线观看| 久久久久久欧美精品色一二三四| 亚洲欧洲一区二区| 国产免费黄视频| 欧美成人中文字幕| 国产在线视频一区| 日韩在线欧美在线| 日本免费在线精品| 久久人妻无码一区二区| 婷婷四房综合激情五月| 91av成人在线| 亚洲人成77777| 国产精品88a∨| 日本精品免费观看| 久久久久久久久久久一区| 日产日韩在线亚洲欧美| 久久久亚洲成人| 日韩成人在线资源| 亚洲欧洲日本国产| 日本精品视频在线播放| 欧美亚洲国产精品| 性欧美激情精品| 国产精品久久久久久久久久小说| 青青a在线精品免费观看| 久久综合伊人77777| 国产久一道中文一区| 色之综合天天综合色天天棕色| 国产精品久久久久久久久久免费| 国产精品亚洲激情| 日本一区二区三区视频在线观看 | 99久久免费国| 黄色一级视频播放| 色婷婷综合久久久久中文字幕| 国产精品美女xx| 久久99精品久久久久久久青青日本 | 精品久久久91| 久久久一本二本三本| 国产精品夜夜夜一区二区三区尤| 亚洲精品偷拍视频| 日韩专区中文字幕| 国产精品视频在线观看| www高清在线视频日韩欧美| 高清一区二区三区日本久| 国产一区二区三区播放| 欧美激情国产日韩| 欧美高清视频一区二区三区在线观看| 欧美一级片免费播放| 亚洲一二三区精品| 欧美激情一区二区三区在线视频观看| 久久精品福利视频| 久久国产精品视频在线观看| 7777精品久久久久久| 99在线观看视频免费| 成人精品久久久| 91精品久久久久久久久青青| 国产在线精品一区| 亚洲国产欧美日韩| 色999五月色| 欧洲日韩成人av| 精品一区二区三区自拍图片区| 免费一级特黄特色毛片久久看| 国产中文日韩欧美| 夜夜添无码一区二区三区| 水蜜桃亚洲精品| 日本www在线播放| 欧美日韩一道本| 国产视频九色蝌蚪| 久久综合亚洲精品| 国产精品露脸av在线| 欧美激情视频在线免费观看 欧美视频免费一 | 7777精品久久久久久| www.日本在线视频| 国产精品6699| 久久久精品欧美| 九九精品视频在线| 日韩一区不卡| 欧美区高清在线| 狠狠精品干练久久久无码中文字幕| 狠狠色噜噜狠狠色综合久| 国模吧一区二区| 粉嫩av一区二区三区免费观看| 国产精品96久久久久久又黄又硬| 久久久噜噜噜www成人网| 国产精品久久久久7777| 欧美日韩福利电影| 日韩最新中文字幕| 国产中文字幕日韩| 国产成人a亚洲精品| 国产精品久久久久久久久久久新郎 | 99国精产品一二二线| 国产激情片在线观看| 久久久97精品| 亚洲一区不卡在线| 欧美怡红院视频一区二区三区| 国产视频一区二区三区四区| 久久视频免费在线| 精品国产乱码一区二区三区四区| 日韩av电影国产| 97精品在线观看| 国产99在线|中文| 日韩久久久久久久久久久久久| 成人免费视频97| 久久久久久久久久久一区| 久久久久久国产精品三级玉女聊斋| 日韩人妻无码精品久久久不卡| 国产精品自拍偷拍| 国产精品福利久久久| 欧美日韩大片一区二区三区| 久久国产日韩欧美| 亚洲激情免费视频| av不卡在线免费观看| 国产精品电影网| 国内成人精品一区| 国产精品国三级国产av| 精品一区2区三区| 久久在线中文字幕| 国产成人精品电影| 日本精品一区二区三区在线| 97免费中文视频在线观看| 亚洲最新免费视频| 97久久精品午夜一区二区| 亚洲在线一区二区| av一区二区在线看| 亚洲在线不卡| 成人精品一区二区三区电影黑人 | 91国在线精品国内播放| 九九热r在线视频精品| 国产亚洲情侣一区二区无| 国产精品国产自产拍高清av水多| 免费特级黄色片| 永久久久久久| 7777精品久久久久久| 日韩午夜视频在线观看| 国产精品久久久影院| 国产一区二区三区色淫影院| 久久国产精品久久久久久| 国产精品一区免费观看| 亚洲欧美日韩精品久久久| 国产精品av免费在线观看| 日本中文字幕成人| 国产精品嫩草影院一区二区| 国产免费xxx| 日韩欧美亚洲区| 久久成人国产精品| 国产成人精品999| 蜜桃精品久久久久久久免费影院| 一区二区欧美日韩| 国产成人久久777777| 91免费精品视频| 欧美精品亚洲| 亚洲v国产v在线观看| 国产精品久久久久久久久久久久午夜片 | 久久久久久久久久久免费精品| 激情视频综合网| 天天综合色天天综合色hd|