美女扒开腿免费视频_蜜桃传媒一区二区亚洲av_先锋影音av在线_少妇一级淫片免费放播放_日本泡妞xxxx免费视频软件_一色道久久88加勒比一_熟女少妇一区二区三区_老司机免费视频_潘金莲一级黄色片_精品国产精品国产精品_黑人巨大猛交丰满少妇

CS5012代做、代寫Python設計程序

時間:2024-03-03  來源:  作者: 我要糾錯



CS5012 Mark-Jan Nederhof Practical 1
Practical 1: Part of speech tagging:
three algorithms
This practical is worth 50% of the coursework component of this module. Its due
date is Wednesday 6th of March 2024, at 21:00. Note that MMS is the definitive source
for deadlines and weights.
The purpose of this assignment is to gain understanding of the Viterbi algorithm,
and its application to part-of-speech (POS) tagging. The Viterbi algorithm will be
related to two other algorithms.
You will also get to see the Universal Dependencies treebanks. The main purpose
of these treebanks is dependency parsing (to be discussed later in the module), but
here we only use their part-of-speech tags.
Getting started
We will be using Python3. On the lab (Linux) machines, you need the full path
/usr/local/python/bin/python3, which is set up to work with NLTK. (Plain
python3 won’t be able to find NLTK.)
If you run Python on your personal laptop, then next to NLTK (https://www.
nltk.org/), you will also need to install the conllu package (https://pypi.org/
project/conllu/).
To help you get started, download gettingstarted.py and the other Python
files, and the zip file with treebanks from this directory. After unzipping, run
/usr/local/python/bin/python3 gettingstarted.py. You may, but need not, use
parts of the provided code in your submission.
The three treebanks come from Universal Dependencies. If you are interested,
you can download the entire set of treebanks from https://universaldependencies.
org/.
1
Parameter estimation
First, we write code to estimate the transition probabilities and the emission probabilities of an HMM (Hidden Markov Model), on the basis of (tagged) sentences from
a training corpus from Universal Dependencies. Do not forget to involve the start-ofsentence marker ⟨s⟩ and the end-of-sentence marker ⟨/s⟩ in the estimation.
The code in this part is concerned with:
• counting occurrences of one part of speech following another in a training corpus,
• counting occurrences of words together with parts of speech in a training corpus,
• relative frequency estimation with smoothing.
As discussed in the lectures, smoothing is necessary to avoid zero probabilities for
events that were not witnessed in the training corpus. Rather than implementing a
form of smoothing yourself, you can for this assignment take the implementation of
Witten-Bell smoothing in NLTK (among the implementations of smoothing in NLTK,
this seems to be the most robust one). An example of use for emission probabilities is
in file smoothing.py; one can similarly apply smoothing to transition probabilities.
Three algorithms for POS tagging
Algorithm 1: eager algorithm
First, we implement a naive algorithm that chooses the POS tag for the i-th token
on the basis of the chosen (i − 1)-th tag and the i-th token. To be more precise, we
determine for each i = 1, . . . , n, in this order:
tˆi = argmax
ti
P(ti
| tˆi−1) · P(wi
| ti)
assuming tˆ0 is the start-of-sentence marker ⟨s⟩. Note that the end-of-sentence marker
⟨/s⟩ is not even used here.
Algorithm 2: Viterbi algorithm
Now we implement the Viterbi algorithm, which determines the sequence of tags for a
given sentence that has the highest probability. As discussed in the lectures, this is:
tˆ1 · · ·tˆn = argmax
t1···tn
 Yn
i=1
P(ti
| ti−1) · P(wi
| ti)
!
· P(tn+1 | tn)
2
where the tokens of the input sentence are w1 · · ·wn, and t0 = ⟨s⟩ and tn+1 = ⟨/s⟩ are
the start-of-sentence and end-of-sentence markers, respectively.
To avoid underflow for long sentences, we need to use log probabilities.
Algorithm 3: individually most probable tags
We now write code that determines the most probable part of speech for each token
individually. That is, for each i, computed is:
tˆi = argmax
ti
X
t1···ti−1ti+1···tn
 Yn
i=1
P(ti
| ti−1) · P(wi
| ti)
!
· P(tn+1 | tn)
To compute this effectively, we need to use forward and backward values, as discussed
in the lectures on the Baum-Welch algorithm, making use of the fact that the above is
equivalent to:
tˆi = argmax
ti
P
t1···ti−1
Qi
k=1 P(tk | tk−1) · P(wk | tk)

·
P
ti+1···tn
Qn
k=i+1 P(tk | tk−1) · P(wk | tk)

· P(tn+1 | tn)
The computation of forward values is very similar to the Viterbi algorithm, so you
may want to copy and change the code you already had, replacing statements that
maximise by corresponding statements that sum values together. Computation of
backward values is similar to computation of forward values.
See logsumexptrick.py for a demonstration of the use of log probabilities when
probabilities are summed, without getting underflow in the conversion from log probabilities to probabilities and back.
Evaluation
Next, we write code to determine the percentages of tags in a test corpus that are
guessed correctly by the above three algorithms. Run experiments for the training
and test corpora of the three included treebanks, and possibly for treebanks of more
languages (but not for more than 5; aim for quality rather than quantity). Compare
the performance of the three algorithms.
You get the best experience out of this practical if you also consider the languages of
the treebanks. What do you know (or what can you find out) about the morphological
and syntactic properties of these languages? Can you explain why POS tagging is more
difficult for some languages than for others?
3
Requirements
Submit your Python code and the report.
It should be possible to run your implementation of the three algorithms on the
three corpora simply by calling from the command line:
python3 p1.py
You may add further functionality, but then add a README file to explain how to run
that functionality. You should include the three treebanks needed to run the code, but
please do not include the entire set of hundreds of treebanks from Universal
Dependencies, because this would be a huge waste of disk space and band
width for the marker.
Marking is in line with the General Mark Descriptors (see pointers below). Evidence of an acceptable attempt (up to 7 marks) could be code that is not functional but
nonetheless demonstrates some understanding of POS tagging. Evidence of a reasonable attempt (up to 10 marks) could be code that implements Algorithm 1. Evidence
of a competent attempt addressing most requirements (up to 13 marks) could be fully
correct code in good style, implementing Algorithms 1 and 2 and a brief report. Evidence of a good attempt meeting nearly all requirements (up to 16 marks) could be
a good implementation of Algorithms 1 and 2, plus an informative report discussing
meaningful experiments. Evidence of an excellent attempt with no significant defects
(up to 18 marks) requires an excellent implementation of all three algorithms, and a
report that discusses thorough experiments and analysis of inherent properties of the
algorithms, as well as awareness of linguistic background discussed in the lectures. An
exceptional achievement (up to 20 marks) in addition requires exceptional understanding of the subject matter, evidenced by experiments, their analysis and reflection in
the report.
Hints
Even though this module is not about programming per se, a good programming style
is expected. Choose meaningful variable and function names. Break up your code into
small functions. Avoid cryptic code, and add code commenting where it is necessary for
the reader to understand what is going on. Do not overengineer your code; a relatively
simple task deserves a relatively simple implementation.
You cannot use any of the POS taggers already implemented in NLTK. However,
you may use general utility functions in NLTK such as ngrams from nltk.util, and
FreqDist and WittenBellProbDist from nltk.
4
When you are reporting the outcome of experiments, the foremost requirement is
reproducibility. So if you give figures or graphs in your report, explain precisely what
you did, and how, to obtain those results.
Considering current class sizes, please be kind to your marker, by making their task
as smooth as possible:
• Go for quality rather than quantity. We are looking for evidence of understanding
rather than for lots of busywork. Especially understanding of language and how
language works from the perpective of the HMM model is what this practical
should be about.
• Avoid Python virtual environments. These blow up the size of the files that
markers need to download. If you feel the need for Python virtual environments,
then you are probably overdoing it, and mistake this practical for a software
engineering project, which it most definitely is not. The code that you upload
would typically consist of three or four .py files.
• You could use standard packages such as numpy or pandas, which the marker will
likely have installed already, but avoid anything more exotic. Assume a version
of Python3 that is the one on the lab machines or older; the marker may not
have installed the latest bleeding-edge version yet.
• We strongly advise against letting the report exceed 10 pages. We do not expect
an essay on NLP or the history of the Viterbi algorithm, or anything of the sort.
• It is fine to include a couple of graphs and tables in the report, but don’t overdo
it. Plotting accuracy against any conceivable hyperparameter, just for the sake
of producing lots of pretty pictures, is not what we are after.
請加QQ:99515681  郵箱:99515681@qq.com   WX:codehelp 

標簽:

掃一掃在手機打開當前頁
  • 上一篇:代做CS252編程、代寫C++設計程序
  • 下一篇:AcF633代做、Python設計編程代寫
  • 無相關信息
    昆明生活資訊

    昆明圖文信息
    蝴蝶泉(4A)-大理旅游
    蝴蝶泉(4A)-大理旅游
    油炸竹蟲
    油炸竹蟲
    酸筍煮魚(雞)
    酸筍煮魚(雞)
    竹筒飯
    竹筒飯
    香茅草烤魚
    香茅草烤魚
    檸檬烤魚
    檸檬烤魚
    昆明西山國家級風景名勝區
    昆明西山國家級風景名勝區
    昆明旅游索道攻略
    昆明旅游索道攻略
  • 短信驗證碼平臺 理財 WPS下載

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

    Copyright © 2025 kmw.cc Inc. All Rights Reserved. 昆明網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    美女扒开腿免费视频_蜜桃传媒一区二区亚洲av_先锋影音av在线_少妇一级淫片免费放播放_日本泡妞xxxx免费视频软件_一色道久久88加勒比一_熟女少妇一区二区三区_老司机免费视频_潘金莲一级黄色片_精品国产精品国产精品_黑人巨大猛交丰满少妇
    亚洲色图100p| 亚洲精品国产成人av在线| 中文字幕 日本| 国产免费无遮挡吸奶头视频| 四川一级毛毛片| 免费毛片视频网站| 视频免费在线观看| 91视频综合网| 国内毛片毛片毛片毛片毛片| 成人午夜福利一区二区| 久久久久无码国产精品一区李宗瑞 | 丰满少妇一区二区三区| 性爱在线免费视频| 日本xxx在线播放| 超级砰砰砰97免费观看最新一期| 黑人と日本人の交わりビデオ| 久久丫精品国产亚洲av不卡| 精品伦一区二区三区| 天天操天天操天天操天天操天天操| 国产一二三四区在线| 久久精品无码一区| 性欧美13一14内谢| 免费看裸体网站| 91动漫免费网站| 成人性生活毛片| 国产精品亚洲一区二区无码| 日本亚洲一区二区三区| 亚洲美女高潮久久久| 日本美女视频网站| 亚洲成年人av| 精品人妻一区二区三区香蕉 | 午夜影院福利社| 韩国三级hd两男一女| 亚洲婷婷在线观看| 成人激情五月天| 1024手机在线视频| 亚洲av网址在线| 色www亚洲国产阿娇yao| 亚洲国产精品免费在线观看| 久久发布国产伦子伦精品| 欧产日产国产精品98| 一区二区三区四区免费| 亚洲成人生活片| 中出视频在线观看| 亚洲区一区二区三| 91亚洲一线产区二线产区 | 91精品国产高清91久久久久久| 337p日本欧洲亚洲大胆张筱雨| bl动漫在线观看| 日本免费www| 伦理片一区二区| 国产极品美女在线| a视频免费观看| 熟女少妇a性色生活片毛片| 国产成人精品一区二区三区在线观看 | 九九精品视频免费| 国产69视频在线观看| 97在线观看免费视频| 免费黄色a级片| 日本裸体美女视频| 日韩精品卡通动漫网站| www.色小姐com| 日韩一级片在线免费观看| 欧美一级片在线免费观看| avhd101老司机| 青青草成人免费视频| www欧美com| 影音先锋男人资源在线观看| 特大黑人巨人吊xxxx| 国产精品熟妇一区二区三区四区 | 男人舔女人下部高潮全视频| 亚洲精品第二页| 韩国av中国字幕| 亚洲国产成人精品综合99| 黄色片网站免费| 中文字幕在线观看网址| 日韩黄色一区二区| 少妇极品熟妇人妻无码| 日韩成人短视频| 中文字幕观看av| 你懂得在线观看| 青青青视频在线免费观看| 阿v天堂2014| 国产精品一区二区亚洲| 五月婷六月丁香| 亚洲码无人客一区二区三区| 中字幕一区二区三区乱码| 泷泽萝拉在线播放| 国产精品无码永久免费不卡| 成人片黄网站色大片免费毛片| 精品无人区无码乱码毛片国产 | 国产小视频你懂的| 日韩精品一区二区亚洲av性色| 日韩欧美视频免费观看| 东方av正在进入| 日本一区二区三区在线免费观看| 熟妇女人妻丰满少妇中文字幕| 九色91porny| 亚洲狠狠婷婷综合久久久久图片| 久久人人爽人人爽人人片| 337人体粉嫩噜噜噜| 男女全黄做爰文章| 9.1人成人免费视频网站| 精品1卡二卡三卡四卡老狼| 亚洲熟妇无码av| 黄色裸体一级片| 成人在线观看一区二区| 国产免费一区二区三区网站免费| 亚洲人与黑人屁股眼交| 国模无码视频一区| 国产在线综合视频| 中文在线字幕观看| a天堂视频在线观看| 亚洲女同二女同志奶水| 日本一级大毛片a一| 国产免费嫩草影院| 一级黄色大片免费看| 国产成人免费观看网站| 欧美激情一区二区三区p站| 女女互磨互喷水高潮les呻吟| 极品久久久久久| av中文字幕免费观看| 久久久久亚洲AV成人| 精品无码一区二区三区| 午夜69成人做爰视频| 色欲狠狠躁天天躁无码中文字幕| 苍井空张开腿实干12次| 精品伦精品一区二区三区视频密桃 | 欧美xxxx日本和非洲| 91精产国品一二三| 少妇熟女视频一区二区三区| 中文字幕第六页| 中文字幕在线观看的网站| 成人自拍小视频| av无码av天天av天天爽| 中文字幕制服丝袜| 久艹在线观看视频| 夜夜春很很躁夜夜躁| 精品无码国产一区二区三区51安| 国产精品丝袜一区二区| 免费一级特黄3大片视频| 亚洲国产欧美视频| 中国黄色片视频| 性高潮免费视频| 日本黄色大片在线观看| 永久看片925tv| www.97视频| www日韩在线| 免费成人深夜蜜桃视频| 国产jjizz一区二区三区视频| 爱爱的免费视频| 国产亚洲色婷婷久久99精品91| 久久久无码人妻精品无码| 免费欧美一级片| 制服.丝袜.亚洲.中文.综合懂| 欧美激情图片小说| 色哟哟免费视频| 欧美大喷水吹潮合集在线观看| 国产51自产区| 人妻少妇一区二区| 人妻一区二区视频| 国内毛片毛片毛片毛片毛片| 99鲁鲁精品一区二区三区| 性色av无码久久一区二区三区| 艳母动漫在线看| 成人午夜精品无码区| 国产精品九九视频| 日本成人免费视频| 久热这里有精品| 中文文字幕文字幕高清| 疯狂揉花蒂控制高潮h| 在线免费观看视频| wwwav国产| 免费的av网站| 成人欧美一区二区三区黑人一| 国产又粗又猛又爽又黄| 欧美特级黄色录像| 69av视频在线| 性少妇bbw张开| 好吊色视频在线观看| 国产 中文 字幕 日韩 在线| 国产调教在线观看| 亚洲AV成人无码精电影在线| 超碰人人cao| 中文字幕一区二区人妻在线不卡| 男女全黄做爰文章| 免费的av网站| 久久久久无码精品| 久久久久久久久福利| 日批视频免费看| 婷婷激情四射网| 制服 丝袜 综合 日韩 欧美| av在线天堂网| 成人在线观看小视频| 中文字幕一二三四区| 精品国产乱码久久久久夜深人妻| 99自拍偷拍视频| 公侵犯人妻一区二区三区| 在线中文字日产幕| 91视频免费在线看|