版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
社交网络复杂网络分析我们中的一些人期待着圣诞节的到来,我们中的一些人期待着《星球大战》系列中的新电影《原力觉醒》。同时,我决定去看看从定量的角度全6-movie循环提取星球大战的社会网络,在每个电影和整个宇宙星球大战。在社会网络的结构揭示了原三部曲和前传之间的一些惊人的差异。*更新:阅读我对第七集《星球大战:原力觉醒》的分析。如果你对我如何提取数据的技术细节感兴趣,那就来看看我是如何做分析部分的。让我们从一些可视化开始。这是所有6部电影联合起来的社交网络:Youcanopenthenetworkinafullwindowwhichwillshowaninteractivevisualizationofthenetworkwhereyoucandragindividualnodesaround.Ifyouhoverovertheindividualnodes,you'llseethenameofthecorrespondingcharacter.Herethenodesrepresentcharactersinthemovies.Thecharactersareconnectedbyalinkiftheybothspeakinthesamescene.Andthemorethecharactersspeaktogether,thethickerthelinkbetweenthem.Thesizeofeachnodecorrespondstothetotalnumberofscenesthecharacterappearsin.Imadeafewarguabledecisionsthough:AnakinandDarthVaderarerepresentedbytwoseparatenodes,becausethisdistinctionisimportanttothestory.Ontheotherhand,theEmperornodealsojointlyrepresentsPalpatineandDarthSidious.IalsomergedAmidalawithPadme.Theoriginaltrilogy(episodesIV,VandVI)ontherightismostlyseparatedinthenetworkfromtheprequeltrilogyontheleftbecausemostcharactersappearonlyinoneofthetrilogies.ThecrucialnodesthatareconnectingthetwonetworksareObi-WanKenobi,R2-D2andC-3PO.Especiallytherobotsseemtoplayanimportantsocialfunctionbecausetheyappearfrequentlyacrossallthemovies.Thestructuresofthetwosub-networksarealsodifferent.sTheoriginaltrilogyhasfewerimportantnodes(Luke,Han,Leia,Chewbacca,DarthVader)andtheyaredenselyinterconnectedbetweenthemselves.Theprequeltrilogyhasmorenodesoverall,withmanymoreconnections.I'lllookatindividualfilmsinmoredetaillaterinthepost.您可以在一个完整的窗口中打开网络,这将显示一个网络的交互式可视化,您可以在其中拖动单个节点。如果在单个节点上悬停,您将看到对应字符的名称。在这里,节点代表电影中的人物。如果两个角色在同一个场景中讲话,则这些字符是通过链接连接的。字符越多,它们之间的联系就越紧密。每个节点的大小对应于角色出现的场景总数。我做了一些有争议的决定,尽管Anakin和达斯·维德是由两个独立的节点来表示,因为这种区分是重要的故事。另一方面,皇帝结还共同代表帕尔帕廷和达斯·西迪厄斯。我也将阿米达拉与Padme。原三部曲(情节IV、V和VI)右边的是网络中的主要分离左侧的前传三部曲因为只有其中的三部曲出现最多的人物。这是连接两个网络ObiWanKenobi的关键节点,R2-D2和C-3PO。特别是机器人似乎发挥着重要的社会功能,因为它们经常出现在所有的电影中。两个子网络的结构也不同。少的原三部曲的重要节点(卢克,汉族,莱娅、巴卡、达斯·维德),他们彼此之间的紧密结合。前传三部曲中有更多的节点的整体,更多的连接。我将在后面的文章中更详细地看各个电影。CharactertimelinesManyofthecharactersfeatureinmultiplemovies,soIalsocreatedacomparisonoftheirtimelinesacrosstheindividualepisodes.Thefollowinggraphicsshowswheretheindividualcharactersarementionedinthefilmscripts.Inorderofappearance,thesearethetimelinesofsomeofthemaincharacters:许多角色在多部电影中都有特点,所以我也在各个情节中创建了他们的时间线比较。下面的图形显示电影脚本中提到的各个字符的位置。在外观上,这是一些主要人物的时间线:HereIincludedallmentionsofeachcharacter,whichincludesothercharactersdiscussingtheirname.ItisinterestingtoseehowAnakinappearssimultaneouslywithDarthVaderduringEpisodeIII,andthenDarthVadertakesover.AnakinagainreappearstowardstheendofEpisodeVIwhenDarthVaderturnsawayfromtheDarkside.Thecharactersthatappearmostconsistentlyacrossallthefilmsarethesameonesthatareinthecentreofthesocialnetwork-Obi-Wan,C-3POandR2-D2.YodaandtheEmperoralsoappearacrossallofthefilmsbuttheydon'ttalkdirectlywithmanypeopleintheoriginaltrilogy,whichmovesthemoffthecentreinthesocialnetwork.在这里,我提到了每个角色的所有提到,其中包括其他字符讨论他们的名字。很有趣的是Anakin在第三集时是如何与达斯·维德同时出现的,然后达斯·维德接手了。Anakin在第六集结束时又重新出现了,达斯·维德转身离开黑暗面。出现最一致的所有的电影都是在社会网络的中心的ObiWan一样的人物,C-3PO和R2-D2。YodaandtheEmperor也出现在所有的电影,但他们不说话直接与原三部曲里的许多人,使他们在社会网络的中心。Networksinindividualfilms个人电影中的网络Nowlet'slookatthenetworksinindividualfilms.Noticehowthenumberofnodesandcomplexityofthenetworkschangebetweentheprequelsandtheoriginalmovies.Again,alinkappearsbetweencharactersiftheyspeakwithinthesamescene.现在让我们看看个人电影中的网络。注意:节点和网络的复杂性的数量变化的前传和电影之间。同样,如果字符在同一场景中说话,则会出现字符之间的链接。ImportanceofcharactersTheindividualnetworksagainshowthattheprequeltrilogyhasmorecharactersandmoreinteractionsoverall.Theoriginalepisodeshavelesscharacters,buttheyinteractmorewitheachother.GeorgeLucassaid:ItreallyisthestoryofthetragedyofDarthVader,anditstartswhenhe'snine,anditendswhenhe'sdead.(source)ButisDarthVader/Anakinreallythecentralcharacter?Let'susesomemethodsfromnetworkanalysistoseewhoisreallyimportantinthestoriesandtheirsocialstructures.Icomputedtwomeasuresofimportanceinthenetworksforeachofthefilms:重要人物个人网络再次表明,前传三部曲有更多的人物和更多的互动的整体。原剧集的角色较少,但它们之间的互动更多。乔治卢卡斯说:“这确实是达斯·维德悲剧的故事,故事从他九岁开始,他死后就结束了。”但是达斯·维达/阿纳金真的是主角吗?让我们使用网络分析的一些方法,看看谁在故事和他们的社会结构中真的很重要。我计算了两个衡量网络中每一个电影的重要性:√Degreecentrality-thisissimplythenumberofconnectionsthenodehasinthenetwork.IntheStarWarsmovies,thiscorrespondstothetotalnumberofsceneswhereeachcharacterspeaks.度中心性-这仅仅是节点在网络中的连接数量。在星球大战电影中,这相当于每个角色说话的场景总数。√Betweenness-thismeasurelooksathowmanyshortestpathsinthenetworkleadthroughthenode.Forexample,imagineyouareLeiaandyouwanttosendamessagetoGreedo-theshortestpathhowtosenditisviaHanSolo,becauseheinteractedbothwithLeiaandwithGreedo.OntheotherhandifyouwanttosendamessagetoLuke,youdon'thavetogothroughHanbecauseLeiaknowsLukedirectly.ThebetweennesscentralityforHaniscomputedusingthenumberofshortestpathsbetweenallothercharactersthatpassthroughhim.中间性-这项措施着眼于网络中有多少条最短路径通过该节点。例如,假设你是莱娅和你想发送一个消息给Greedo的最短路径如何发送它通过HanSolo,因为他有Leia和Greedo的互动。另一方面,如果你想发送一个消息给卢克,你不必经过Han因为莱娅知道卢克直接。Han使用通过他的所有其他字符之间的最短路径数来进行计算。Thetwomeasuresbothshowhowimportantisacharacterinthenetwork.Thedegreecentralityshowshowmanypeopledoeseachcharacterinteractwithdirectly.Thebetweennessrelatesmoretohowintegraleachofthecharactersistothestory.Characterswithhighbetweennessconnectdifferentareasofthesocialnetwork.Forbothmeasures,highervaluesmeanmoreimportance.Herearethetop5charactersforeachmovie:这两项措施都显示了网络中人物的重要性。度中心表示每个字符直接与多少人交互。这中间涉及到如何整体的每一个人物的故事。中介性连接的社会网络的不同的区域。对于这两种度量,更高的值意味着更重要。下面是每部电影的前5个字符:ItseemsthatAnakinisoverallthemostconnectedcharacterinthefirstthreefilms,basedonhisdegree.Heishowevernotveryintegraltotherelationsinthefilms!Hisbetweennessscoreissosmallhenevermakesittothetop-5characters.ThismeansthatalltheothercharactersinteractdirectlybetweenthemselvesratherthanthroughAnakin.Howdothesamemeasureslookfortheoriginaltrilogy?根据他的学位,Anakin似乎是前三部电影中最有联系的人物。然而,他并不是电影中关系中不可或缺的人物!他的得分是如此之小,他从不介了五大人物。这意味着所有其他字符直接在自己之间进行交互,而不是通过Anakin。同样的方法是如何寻找原始三部曲的?Hereboththecentralitymeasuresshowverysimilarresults-Lukeisthemostcentralcharacteracrossallthefilms,andusingbothmeasures.Theorderofcharactersbasedonthetwomeasuresisalmostthesame.Thecentralityanalysisquantifiessomeofthethingswecouldseefromthesocialnetworks.Theprequeltrilogyhasmorecomplexsocialstructures,withmoreinterconnectedcharacters.ThisalsoleadstothefactthatAnakinisnotthatcentraltothestory-someofthestorylineshappenalongsideAnakin'sstory,orinvolveAnakinonlyontheside.Ontheotherhand,theoriginaltrilogyhasamoretight-knitstructure.Thereisasmallernumberofcentralcharactersandtheybindthestorytogether-thisresultsintotheagreementbetweenthedegreeandbetweennesscentralitymeasures.Perhapsthisispartofthereasonwhytheoriginaltrilogyismorepopular-theplotsaremoreconsistentanddrivenbythemaincharacters.Theprequelshaveamoredecentralizedstructureandnoclearhero.AlthoughthestoriesarelinkedbyAnakin,heisnotbindingtheothercharacterstogether.Howdothemeasureslookwhenwelookatthefullsocialnetworkfromalltheepisodestogether?Ilookedattwovariantsofthenetwork.InthefirstoneAnakinandDarthVaderappearastwoseparateindividuals,inthesecondImergedthemtogetherintoasingleperson.在这里,两个中心测量都显示出非常相似的结果——卢克是所有电影中最核心的人物,同时使用这两种方法。基于这两个度量的字符顺序几乎相同。中心性分析量化了我们从社交网络中可以看到的一些东西。前传三部曲有更复杂的社会结构,与更多的关联特征。这也导致Anakin不是一些情节发生在Anakin的故事中,或是Anakin只能在一旁。另一方面,原始三部曲的结构更加紧凑。有少量的中心人物和他们的故事一起绑定结果进度和中介中心性措施之间的协议。也许这是原始三部曲更受欢迎的部分原因——情节更为一致,由主要人物推动。前传有更分散的结构并没有明确的英雄。虽然这些故事是由Anakin联系在一起的,但他并没有把其他的人物连在一起。当我们从所有的剧集中看完整的社交网络时,这些措施是怎么看的?我看了两种不同的网络。第一个阿纳金和达斯·维德是两个独立的个体,第二个我把他们合并成一个人。IfwelookatAnakinandDarthVaderseparately,Anakinisstillthemostconnectedcharacterbuthe'snotcentraltothenetwork.Ifwemergethemtogether,thingsimproveabit.NowDarthVader/Anakinisthethirdmostimportantcharacterintermsofbetweenness.Overall,thesocialnetworksseemtoshowthattheStarWarsmoviesareactuallylinkedtogetherbyObi-WanKenobiratherthanDarthVader.如果我们分别看Anakin和达斯·维德,Anakin仍然是最有联系的人物,但他不是网络的核心人物。如果我们把它们合并在一起,情况就会有所改善。现在,达斯·维德/阿纳金从中间最重要的第三个字。总的来说,社会网络似乎表明,星球大战电影实际上是由ObiWanKenobi而不是达斯·维德联系在一起的。HowIdidtheanalysisAsthisispartoftheF#Adventcalendar,IusedF#formostoftheanalysis.IcombinedittogetherwithD3.jsforthesocialnetworkvisualizations,andwithRforthenetworkcentralityanalysis.YoucanfindallthesourcecodeonmyGitHub.Becausethewholecodeturnedouttoberelativelylong,hereIlookonlyatsomeofthemoreinterestingparts.我是怎么做分析的?这是F#日历的一部分,我用F#大部分的分析。我把它连同社会网络可视化d3.js,和R的网络中心性分析。你可以在我的github找到所有的源代码。因为整个代码比较长,所以我只看一些更有趣的部分。ParsingthescreenplaysIstartedbydownloadingallthescriptsforthe6StarWarsmovies.TheyarefreelyavailablefromTheInternetMovieScriptDatabase(IMSDb),forexamplehere'sthescriptforEpisodeIV:TheNewHope.Thescreenplaysareonlyintheformofdraftsthatsometimesdifferfromtheactualfilms-thedifferencesarehowevernotverybig.我开始下载6星球大战电影的所有脚本。他们可以自由地从互联网电影数据库(imsdb脚本),例如这里的插曲四脚本:新的希望。剧本只在有时与实际电影的差异却不很大的汇票的形式。Thefirststepwastoparsethescreenplays.Tocomplicatethings,eachofthemusedaslightlydifferentformat.ThescreenplaysthemselveswereinHTML,eitherwithinthe<tdclass="srctext"></td>tags,orwithinthe<pre></pre>tags.Toextractthecontentsofeachscript,IusedtheHtmlParserfromF#DatalibrarywhichallowsaccessingindividualtagsinaHTMLdocumentusingstatementslike第一步是分析剧本。为了使事情复杂化,他们每个人都使用了稍微不同的格式。剧本本身是在HTML中,<tdclass="srctext"></td>tags,orwithinthe<pre></pre>tags无论是在<<TDclass=“srctext”></标签,或在<><>标记/预预。提取每个脚本的内容,我用HTML解析器从F#数据库,允许使用诸如HTML文档访问单独的标签ThefullcodeforthispartisavailableintheparseScripts.fsfile.Thenextstepwastoextractrelevantinformationfromthescripts.Ingeneral,ascriptlookslikethis:对于这部分的完整代码在parsescripts.fs文件是可用的。下一步是从脚本中提取相关信息。一般来说,脚本如下所示:Eachscenestartswithitssetting:INT.(interior)orEXT.(exterior)andthelocationofthescene.Thentherecanbesomefreetextdescribingwhatishappeningandhowdoesthescenelook.Inthedialogues,thenamesofcharactersarewrittenincapitalletters(sometimesalsoinbold),followedbywhattheyaresaying.ThemainsignpostsinthescreenplayaretheINT.andEXT.statementswhichserveassceneseparators.Thesewerewrittenconsistentlyinboldinallthe6scriptsandIusedthemtosplitthemintoindividualscenes:每一个场景开始设置:INT.(室内)或EXT.(外观)和场景的位置。然后就可以有一些免费的文字来描述正在发生的事情,以及场景的外观。在对话中,人物的名字用大写字母写(有时也用黑体字),后面跟着他们说的话。在剧本的主要标志是信息和外部报表作为场景分离器。在所有这6个脚本中,这些都是用粗体写的,我用它们把它们分割成单独的场景:Thisisarecursivefunctionthattakesthefullscreenplayandlooksforthespecificpattern,whichisEXT.orINT.inbold,optionallyprecededbyascenenumber.Thefunctiongoesthroughthestringandwhenitencountersthescenebreak,itsplitsthestringintothecurrentsceneandtheremainingtext.Thenitrunsrecursivelyuntilallthescenesareextracted,usingthescenesvariableasanaccumulator.这是一个递归函数,以完整的剧本和寻找特定的模式,这是EXT.orINT.inbold,前面可以使用场景的数量。函数通过字符串,当它遇到场景中断时,它将字符串分割为当前场景和剩余文本。然后递归地运行,直到所有场景被提取,使用场景变量作为累加器。GettinglistofcharactersThepreviousfunctiongavemealistofscenesforeachofthemovies.Extractingthecharactersoutofthemturnedouttobemoredifficult.SomeofthescenesfollowedtheformatthatIshowedintheexampleabove,someofthescenesonlyusedcharacternamesfollowedbyacolonandtheirdialogue,allwithinthesamelineinthetext.Theonlycommonpropertybetweenthedifferentformatswasthatthenameswerealwayswrittenincapitalletters.获取字符列表前一个功能给了我一张每部电影的场景列表。从中提取字符变得更加困难。有些场景遵循我在上面的例子中所展示的格式,一些场景只使用字符名,后面是冒号和它们的对话,它们都在文本的同一行中。不同格式之间唯一的共同属性是名字总是用大写字母写的。Iresortedtoregularexpressions,oneforeachscreenplayformat:Eachoftheregularexpressionsmatchesnotonlycapitalletters,butalsonumbers,hypens,spacesandslashes.AllbecausethecharactersinStarWarsusenameslike"R2-D2"oreven"FODE/BEED".每一个正则表达式匹配不仅大写字母,也是数字,连字符,空格和斜线。因为在星球大战人物使用的名字如“R2-D2”甚至“"FODE/BEED"”。Toactuallyextractthelistofcharactersthatappearacrossthefilms,Ialsohadtotakeintoaccountthefactthatmanycharactersusemultiplenames.SenatorPalpatineturnsintoDarthSidiousandthenintoTheEmperor,AmidaladisguisesherselfasPadme(ortheotherwayaround?).BecauseofthisImanuallyputtogetherasimplefilealiases.csvwhereIspecifiedwhichnamesIconsidertobethesame.Iusedtheseasamappingontoauniquenameforeachcharacter(exceptforAnakinandDarthVader).为了实际提取电影中出现的字符列表,我还得考虑到许多字符使用多个名称的事实。帕尔帕廷参议员变成达斯·西迪厄斯然后到皇帝,阿米达拉化装成Padme(或其他方式?)因为这我手动把一个简单的文件aliases.csv我指定的名字我认为是相同的。我把这些映射到每个字符的唯一名称(除了Anakin和达斯·维德)。NowIcouldfinallyextractnamesofcharactersfromtheindividualscenes!Thefollowingfunctionextractsallthenamesofcharactersfromallthescreenplayurls.现在我终于可以从单个场景中提取人物的名字了!以下函数从所有脚本URL中提取所有字符的名称。Theonlyremainingproblemwasthatmanyofthenameswerenotactualnames.Thelistwasfullofpeoplecalled"PILOT"or"OFFICER"or"CAPTAIN".AfterthisImanuallywentthroughtheresultsandfilteredoutthenamesthatwereactualnames.Thisresultedinthecharacters.csvfile.唯一剩下的问题是,许多名字不是真正的名字。名单上满是名为“飞行员”、“军官”或“船长”的人。在此之后,我手动检查结果并过滤掉实际名称的名称。这导致了characters.csv文件。InteractionsbetweencharactersToconstructthesocialnetworks,Iwantedtoextractalltheoccasionswhentwocharacterstalktoeachother.Thishappensiftwocharactersspeakwithinthesamescene(Idecidedtoignoresituationswhenpeopletalkwitheachotheroveratransmitter,andthereforeacrossscenes).ExtractingcharactersthatarepartofthesamedialoguewasnowsimplifiedbecauseIcouldjustlookatthelistofcharactersIputtogetherinthepreviousstep.字符之间的相互作用为了构建社交网络,我想提取两个字符相互交谈的所有场合。如果两个字符在同一场景中讲话(我决定忽略人们在发射机上交谈,因此在场景中交谈),就会出现这种情况。提取属于同一对话部分的字符现在简化了,因为我可以只看一下我在上一步中放在一起的字符列表。HereIcreatedasetofallcharacternamesandtheiraliasestouseforlookupandfiltering.ThenIusedittosearchthroughthecharactersappearingineachscene:在这里,我创建了一组所有字符名称及其别名,用于查找和过滤。然后我用它来搜索每个场景中出现的字符:ThenIusedthefilteredlistofcharacterstodefinethesocialnetwork:然后,我使用过滤后的字符列表来定义社交网络:Thisgavemealistofnodeswiththenumberoftimestheyspokeacrossthewholescript,whichIusedtospecifythesizeofnodesinthevisualizations.ThenIcreatedalinkforeachtimetwocharactersspokewithinthesamescene,andcountedthemtogetthestrengthofeachrelationship.Together,thenodesandlinksdefinedthefullsocialnetwork.这给了我一个节点列表,它们在整个脚本中发言的次数,我用来指定可视化中节点的大小。然后,我创建了一个链接,每次两个字符在同一场景中发言,并计算它们获得每一个关系的力量。在一起,节点和链接定义了完整的社交网络。Finally,IexportedthedataintotheJSONformat.Youcanfindallthenetworks,boththeglobaloneandtheindividualepisodes'networks,onmyGithub.ThefullcodeforthisstepisinthegetInteractions.fsxscript.最后,我将数据导出到JSON格式。你可以找到所有的网络,无论是整体和个体事件的网络,在我的GitHub。在这一步中的完整代码是在getinteractions.fsx脚本。CharactermentionsinthescriptIalsodecidedtolookatwhereeachofthecharactersappearsthroughoutthesixmoviecycle,resultinginthetimelineschart.ForthisIlookedatallthetimesthenameofthecharacterwasmentionedinthescripts,notlimitedtothenumberoftimesthecharacteractuallyspoke.Thecodeforthiswaslargerlysimilartoextractingtheinteractionsintheprevioussection,onlyhereIwaslookingforallthementionsandnotonlyforthedialogues.Togettheactualtimelines,Ialsokepttrackofthescenenumbers.Thefollowingcodesnippetreturnsalistofscenenumbersandcharactersthatarementionedinthem.脚本中提到的字符我还决定查看每个角色在六个电影周期中出现的时间线图表。为此,我看了所有的时间,在剧本中提到了人物的名字,而不仅仅限于人物所说的次数。这个代码是由类似于前一段的相互作用中,只有我在这里寻找所有提到不仅为对话。为了得到实际的时间线,我也记录了场景编号。下面的代码片段返回其中提到的场景编号和字符列表。Togetthefulltimeline,Iusedthescenenumberstomapeachepisodeintoa[episodeindex−1,episodeindex]interval,givingmearelativescaleofwhereintheepisodethecharacterappeared.Thescenetimesinintervals[0,1]arefromEpisodeI,in[1,2]correspondtoEpisodeIIetc.得到充分的时间,我用现场数字地图每集为一个[事件指数−1集指数]区间,给我一个相对规模在一集的角色出现。在区间[0,1]上的场景的时间从第一集,在[1,2],对应第二集等。Isavedthisdataintoanill-formatedpseudo-csvfile,whereeachrowcontainsacharacternameandtherelativetimesthecharacterappearedacrossthe6films,separatedbycommas.ThefullcodeisinthegetMentions.fsxfile.我救了这个数据不形成伪CSV文件,其中每一行包含一个字符的名称和相应的时代特征出现在6部电影中,以逗号分隔。完整的代码是在getmentions.fsx文件。Addingnon-speakingcharactersWhenIcomparedtheinteractionsandthecharactersthatwerementionedinthescripts,Inoticedthatsomethingwasdifferent:therewasnoR2-D2andnoChewbacca.NotonlythepoorWookieedidn'treceiveanymedalattheendofEpisodeIV(likethehumanheroesdid),buthewasmissingfromallthedialoguesinthescreenplays!Actually,bothChewbaccaandR2-D2appearthroughoutthescriptsasnon-speakingcharacters.TheyarementionedinlineslikeArtoofindssomethingthatmakeshimwhistlewildly.orAsuddenfrowncrossesChewbacca'sfaceandhebeginsyellinggibberishatthetinyrobot.当我比较,在脚本中提到的作用和特点,我注意到有些不同:没有R2-D2和没有Chewbacca。可怜的Wookiee不仅没有受到任何金牌的第四端(如人类的英雄一样),但他在剧本的所有对话的缺失!其实,无论是Chewbacca和R2-D2出现在脚本作为非母语的特点。他们提到的线条如下阿图发现一些让他疯狂地吹口哨。或突然皱眉穿过Chewbacca的脸,他开始大喊大叫,胡言乱语的小机器人。Itwouldn'tbeaproperStarWarssocialnetworkifweignoredthesetwoimportantcharacters.TocorrectfortheracialdiscriminationagainstWookieesandastromechdroids,Idecidedtoinsertthemintothesocialnetworkdefinedbydialogues.Ilookedagainatallthetimesthesecharactersgotmentionedinthescreenplay.Thementionsalsodefineasocialnetworkwheretwocharactersarelinkedtogetheriftheyarementionedinthesamescene.Becausethecharactersareincludedinthescenedescriptionsandtheyalsotalkabouteachothermorethantheyactuallyappearonscreen,thenetworkdefinedbyallmentionsismuchmessierthanthenetworkdefinedbydirectinteractions.Becauseofthis,Icouldn'tusetheChewbacca'sandR2-D2'sconnectionsdirectlyinthesocialnetwork.Icouldhoweveruseitasanapproximation.如果忽略了这两个重要人物,这将不是一个合适的星球大战社交网络。正确的对Wookieesandastromech机器人种族歧视,我决定将它们插入到由对话的社会网络。我又看了一遍这些角色在电影剧本中提到的时代。提到的还定义了一个社交网络,如果两个字符在同一场景中被提及,那么它们会链接在一起。因为汉字中包含的场景描述,他们也谈论对方其实比他们出现在屏幕上,所有提到的定义网络是比直接相互作用定义的网络乱得多。因为这个,我不能用楚巴卡和R2-D2的连接直接在社交网络。我可以用它作为一个近似值。Iextractedthenodesizesandlinksforthetwomissingcharactersfromthenetworkdefinedbymentions.Totransformthemintoconnectionsfromthesocialnetwork,Idecidedtoscalealltheirvaluesbycomparingthemwithsimilarcharacters.Forthis,IchoseC-3POasaproxyforR2-D2,andHanasaproxyforChewie,assumingtheirinteractionswerelargelysimilar.ThenIappliedthefollowingformulatocomputethelinkstrengthsinthedialoguesocialnetwork(thisexampleusesChewbaccaandHan):我从所定义的网络中提取了两个丢失字符的节点大小和链接。为了将它们转换成社交网络的连接,我决定通过与类似的字符比较它们的所有值。为此,我选择了C-3PO作为代理的R2-D2,汉为代理Chewie,假设它们之间的相互作用在很大程度上是相似的。然后我使用下面的公式计算在对话中社会网络的链接强度(本例使用楚巴卡和汉族):Iusedthishighlyscientificequationtorecomputeallthelinkstrenghtsandalsothenodesizes.Theweightfactorwasaround0.5bothforHanandC-3PO,whichmeansthecharacterswereonaveragementionedtwotimesmorethantheyactuallyspokeinthefilms.Afterthis,Idiscardedallthelinksthathadtheirweightsmallerthanone.Thecodeforthisstepisrelativelylongbutnotveryinteresting.我用这个很科学的公式重新计算所有的链接强度和节点的大小。权重系数是0.5左右的汉族和C-3PO,即性状平均比他们竟然说在电影中两次提到。在此之后,我放弃了所有的链接,他们的重量比一个小。这一步的代码比较长,但不是很有趣。VisualizationsAftermanuallyaddingbackChewbaccaandR2-D2,Ifinallyhadthefullsetofsocialnetworksbothfortheindividualmoviesandforthefullfranchise.IusedtheForcetovisualizethenetworks...well,Iactuallyusedtheforce-directednetworklayoutfromtheD3.jslibrary.Thisvisualizationmethodusesaphysicalsimulationofchargedparticlestogenerateanetworklayout.ThemostimportantpartoftheD3JavaScriptfileisthefollowingpart:可视化效果在手动添加回楚巴卡和R2-D2,我终于有了对个人电影和完整的特许经营社交网络的全套。我用原力使网络可视化…嗯,其实我用的有向网络布局从d3.js图书馆的力量。这种可视化方法使用带电粒子的物理模拟来生成网络布局。D3JavaScript文件中最重要的部分是以下部分:Inthe
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 大学生创新创业项目专项资金申请
- 牛奶厂 HACCP 体系运行手册 (标准版)
- 《县域农产品加工流通产业链手册》
- 纺织品染整技术与质量控制手册
- 艺术品防潮防损养护手册
- 医疗废弃物与生活垃圾区分手册
- 电工部分试题及答案
- 2026-2031年中国集装箱运输行业市场调查分析及发展战略咨询研究报告
- 2027年湖南城建职业技术学院单招职业技能考试题库【A卷】附答案详解
- 2024年秦源专修高职学院高职单招职业技能考试模拟试卷附参考答案详解【培优A卷】
- 公司采购代理授权证明书(6篇)
- 咳嗽与咳痰讲课件
- 除氟药剂采购合同协议
- 四川富润招聘笔试真题2024
- 不合格标本处理制度及流程
- 末梢血糖监测操作流程
- 养老护理员三级应知应会试题及答案
- 一厂多租(厂中厂)厂区安全生产管理标准
- 消防设施自查报告
- 四川《建筑施工企业安全责任清单参考模板》(1.0版)
- 机械租赁施工公司机构设置
评论
0/150
提交评论