COMP 4446 / 5046 Assignment 2
Due:Monday,May15th(ie.,thestartofweek 12 ofsemester)
Inthisassignment,youwilllearnaboutakeypartofNLP:dataannotation.Thisisoftenthe
mostcriticalpartofworkonaproject.Ifyoudonotcreateaccuratedatasetsfortrainingand
evaluationthenitdoesn’tmatterhowgoodyourmodelis,youwillnotbeabletobuildan
effectivesystem.
Theassignmenthasaseriesofstages.Notethatafterstage 1 youneedtowaitforusto
sendyouafilebeforeyoucandostage 2 (andtherestoftheassignment).Wewillrespond
within 3 businessdays.
0 - Forming Groupsof1-3 students
Youmayworkonyourownorinagroupof 2 or 3 students.Youneedtodotwothingsinthis
stage:
- FormgroupsonCanvas.Seeinstructionshere.
- Onceyouhaveyourgroup,pleasewriteitdowninthisspreadsheet.
1 | PleaserecordboththemembersinyourgroupandthegroupIDyouhaveinCanvas. |
1 - InitialAnnotation
Inthissectionoftheassignment,youwillannotatedata(~2,500tokensoftext)anddevelop
annotationguidelinesthatdescribeyourannotationprocess.Thisannotationshouldbedone
byyou,notbyanAImodel.
- Downloadthedatafromhere.
- Findthefilethatmatchesyourgroupnumber(fromthespreadsheetinstage0).
- Read theinitial annotationguide(GoogleDocorWordDoc).Note,theguidehas
beenupdatedtoincludethatnestednamedentitiesshouldbeannotated.Theguide
hasanexample. - Eachstudentinyourgroupshouldindependently,withoutdiscussion,annotatethe
fileandkeepnoteson(a)examplesofeachcategory,and(b)explanationsofwhat
youchosetodoinunusualcases,alongwithexamples.
1 | Note:youmaydiscusstechnicaldecisionsaboutwhattooltouseforannotation,how |
- Storeyourannotationsasa“.txt”filewithonelineperannotation,inthisformat:
1 | ((linestart,tokenstart),(lineend,tokenend))-label |
1 | For example,ifa Personentity spannedthefirsttwotokensinthethirdline,you |
((2, 0), (2, 1)) - PER
1 | For itemsthat spana singletokenyoumaysaveitinoneoftwoways(eitheris |
1 | Note: |
- Meetasagroupandcreateanewversionoftheannotationguidethatadds:
○ Newexamplesofeachcategorythatcomefromyourdata.
○ Discussionofunusualcases,withthedecisionseachofyoumadeandwhatyourgrouphasdecidedisthebestapproachinfuture.
Todotheannotation,youmayuseanytoolyoulike.WerecommendSLATE,whichfollows
thefileformatdescribedabove.Someotherfreeoptionsaredocanno,andINCEpTION.If
youuseatoolthathasanauto-annotationmodeorsemi-automaticannotationmode(e.g.
bratandprodi.gyhavesuchmodes),pleasedonotuseitinthisassignment.Allannotations
shouldbedonebyyou.
Submit-https://canvas.sydney.edu.au/courses/ 48399 /assignments/ 446897
1 | (a)PDFofyourannotationguide |
2 - Adjudicationand Refinement
Inthissection,youwilladjudicatedisagreementsintheannotationsofyourfile.Ifyourgroup
hasNmembersthenyouwillbecomparingN+!annotationfiles(theextraoneistheonewe
providetoyou).Thisadjudicationshouldbedonebyyou,notbyanAImodel.
- Downloadtheannotationsweprovideandfindthefileforyourgroup.
- Go through the annotations as a group and resolve every case where the
annotationsdonotmatch.Afterdoingthisyoushouldhaveasinglefilethatisthe
agreedannotations. - Atthesametime,addandremoveexamplesandexplanationsfromyourannotation
guidesothatitexplainsyourdecisions.a. For content you want to remove from the annotation guide, draw a line throughthetext(ie.,astrikethrough). b. Forcontentyouwanttoadd,includeitinbluetextsoitisclearlydifferentfrom theoriginaltext(whichshouldbeinblack).
Note-youshouldnotaddorremoveentirelabeltypeshere.Alwaysusethe 6 typeswe
specifiedintheinitialannotationguide.Youareonlychangingtheguidetoclarifyhowtodo
annotationforcasesthatmightbeambiguousortricky.
Submit-https://canvas.sydney.edu.au/courses/ 48399 /assignments/ 452047
1 | (a)PDFoftherevisedannotationguidewithstrikethroughsandbluetext |
3 - Improved Annotation
Now,youwillannotateanotherpieceoftext,usingyourrevisedguidelines.Thisannotation
shouldbedonebyyou,notbyanAImodel.
- Downloadthedatafromhere.
- Findthefilethatmatchesyourgroup
- Independently, withoutdiscussion,eachstudentinyourgroupshouldannotatethe
file.
Submit-https://canvas.sydney.edu.au/courses/ 48399 /assignments/ 452048
1 | (a)Textfilesofyourannotations,onetextfileforeachperson |
4 - Evaluation Metrics
Inthissection,youwillimplementametrictoseehowconsistentyourannotationsare.
- ImplementF-Score(seelecture 8 orthiswikipediaarticle).Note,tobeconsidereda
match,anannotationmusthavethesamespanandthesamelabel. - Calculate F-Score for each pair of annotations in stage (1) of the assignment,
including theannotationswe provide.If youareworkingonyourownthismeans
calculatingtheF-Scorebetweenyourannotationsandtheonesweprovided.Ifyou
areinagroupof 2 youwillcalculatethreevalues(personA-personB),(personA-
provided),(person B-provided). Ifyouareinagroup of 3 youwillcalculatesix
values.
1 | Ifyouareworkinginagroupwith2+peoplethenalsocalculatetheaverageofthe |
- Repeatthepreviousstepusingthedatafromstage(3)oftheassignment.Ifyouare
workingonyourown,youshouldcomparewiththeoutputinthisfile.
Submit-https://canvas.sydney.edu.au/courses/ 48399 /assignments/ 452051
1 | Anipynbfilecontaining(a)yourcodeforcalculatingthemetricsand(b)theresultsof |
5 - Model Evaluation
Inthissection,youwillmeasuretheaccuracyonyourdataofthreewidely-usedmodels.
- RunFlair,SpaCy,andStanzaonyourdata.Note,youshouldusetheir18-classNER
models.
1 | The 18 classesthosemodelsproduceinclude 5 oftheonesweconsiderhere.You |
- Evaluateonyourdatafromstage 2 (ie.,theadjudicateddata).
1 | Note:Youwillneedtomaptheiroutputtoourformat.Sometimestokenisationwillnot |
Submit-https://canvas.sydney.edu.au/courses/ 48399 /assignments/ 452052
1 | (a) Text filescontainingthe outputofthe threemodels onyour adjudicated data |
1 | Flair-SCORE |
1 | Where‘SCORE’isreplacedbytheF-Scoreforcomparingthemodel’soutputtoyour |
6 - [Bonus]Competition
Thisisanoptionalsectionwhereyoutrainmodelsforthistask.Wewillprovideallofthe
datastudentshavesubmittedinstages1,2,and3,whichyoucanusefortraining.Youwill
betestedonaseparatedatasetannotatedbythetutors.
Moredetailsofthecompetitionwillbereleasedlater.Itwillalsohaveadeadline 1 weekafter
the main assignment deadline (May 22nd). There will be NO EXTENSIONS for the
competition.
The competition can either be completed in the same group as for the rest of the
assignment,oronyourown.
Ifyoureceivebonusmarksandtheytakeyouroverallmarkfortheassignmentover 20 (ie.
100%)thenthebonuscancounttoyouroverallnon-examcoursemark.
Mark Allocation
Thetablebelowshowsthevalueofeachsection,brokendownacrosstheitemsyousubmit.
1 | Section Value Breakdown |
1 | 1 - InitialAnnotation 5 2 - Annotations |
1 | 2 - Adjudicationand |
1 | 5 2 - Adjudicatedannotations |
1 | 3 - ImprovedAnnotation 2 2 - Annotations |
1 | 4 - EvaluationMetrics 4 2 - Code |
1 | 5 - ModelEvaluation 4 1 - Flairoutput |
Note:YourannotationsMUSTmatchthefileformatwespecifiedinstage1.Iftheydonot,
youwillscore 0 forthem.
Bonuspointsinthecompetitionareawardedasfollows:
- Top25%ofentrants,+1point
- Top10%ofentrants,+2points
- Top 2 entrants,+3points