From Several Hundred Million to Some Billion Words: - - PowerPoint PPT Presentation

from several hundred million to some billion words
SMART_READER_LITE
LIVE PREVIEW

From Several Hundred Million to Some Billion Words: - - PowerPoint PPT Presentation

From Several Hundred Million to Some Billion Words: Scaling up a Corpus Indexer and a Search Engine with MapReduce Jordi Porta ComputaBonal


slide-1
SLIDE 1

From ¡Several ¡Hundred ¡Million ¡to ¡Some ¡Billion ¡Words: ¡ ¡ Scaling ¡up ¡a ¡Corpus ¡Indexer ¡and ¡a ¡Search ¡Engine ¡ ¡ with ¡MapReduce ¡

Jordi ¡Porta ¡ ComputaBonal ¡LinguisBcs ¡Area ¡ Departamento ¡de ¡Tecnología ¡y ¡Sistemas ¡ Centro ¡de ¡Estudios ¡de ¡la ¡Real ¡Academia ¡Española ¡ (porta@rae.es) ¡

slide-2
SLIDE 2

Outline ¡ ¡

“The ¡more ¡observa-ons ¡we ¡gather ¡about ¡language ¡use, ¡ the ¡more ¡accurate ¡descrip-on ¡we ¡have ¡about ¡language ¡itself” ¡ ¡

Lin ¡& ¡Dyer, ¡2010: ¡Data-­‑intensive ¡text ¡processing ¡with ¡MapReduce ¡

  • A ¡Case ¡Study: ¡Elpais.com ¡
  • Basic ¡Data ¡Structures ¡for ¡Complex ¡Queries ¡ ¡
  • IntroducBon ¡to ¡MapReduce ¡
  • The ¡Scale ¡out ¡vs. ¡Scale ¡up ¡Dilemma ¡
  • Scaling ¡up ¡with ¡Phoenix++ ¡
  • Experiments ¡introducing ¡MapReduce ¡into ¡a ¡CMS: ¡

– Query ¡Engine: ¡

  • Word ¡CounBng ¡
  • Word ¡Cooccurrencies ¡
  • N-­‑grams ¡

– Indexer ¡

  • File ¡Inversion ¡

– Text ¡Inversion ¡ – Structure ¡Inversion ¡

2 ¡

“The ¡only ¡thing ¡ be<er ¡than ¡big ¡data ¡ is ¡bigger ¡data” ¡

slide-3
SLIDE 3

A ¡Case ¡Study: ¡Elpais.com ¡on-­‑line ¡archive ¡ ¡

3 ¡

  • Lists ¡of ¡linguisBc ¡elements: ¡
  • Concordances ¡
  • Counts ¡
  • AssociaBons ¡
  • DistribuBons ¡
  • … ¡
  • Sub-­‑corpora ¡
  • Non-­‑trivial ¡processing: ¡ ¡
  • Cooccurrence ¡networks ¡/ ¡

¡ ¡ ¡ ¡ ¡ ¡clustering ¡/ ¡… ¡

  • Word ¡vectors ¡
  • … ¡

Base ¡Corpus: ¡ ¡

  • Elpais.com ¡on-­‑line ¡archive: ¡
  • 1976–2011 ¡
  • 2.3 ¡million ¡news ¡ ¡
  • Cleaned ¡+ ¡PoS ¡tagged ¡
  • 23 ¡million ¡structural ¡elements ¡
  • 878 ¡million ¡tokens ¡

¡

slide-4
SLIDE 4

Basic ¡Data ¡Structures ¡for ¡Corpus ¡Indexing ¡ SupporBng ¡Complex ¡Queries ¡ ¡ ¡

  • Textual ¡indices: ¡ ¡

– PosBng ¡Lists: ¡ ¡

  • [token=“de”] ¡
  • [token=“la” ¡and ¡msd=“Nfs”] ¡
  • [token=“pelota”] ¡within ¡[secBon=“sports”] ¡
  • … ¡
  • Structural ¡indices: ¡ ¡

– Interval ¡Trees: ¡

  • P ¡within ¡TEXT ¡
  • P ¡containing ¡HI[REND=IT] ¡containing ¡[lemma=“de”] ¡ ¡
  • … ¡
  • Red/Black-­‑Trees ¡

4 ¡

Doc ¡id ¡ Hits ¡ Pos1 ¡ ¡ ¡Pos2 ¡ … ¡ Doc ¡id ¡ First ¡ Token ¡ Last ¡ Token ¡ … ¡ <p> ¡ </p> ¡

slide-5
SLIDE 5

How ¡Text ¡is ¡Indexed ¡ ¡

5 ¡

String ¡ Singletons ¡ Documents: ¡

  • begin, ¡
  • end, ¡
  • ffset ¡
  • ¡… ¡

PosiBonal ¡ Indices ¡ Structural ¡ Indices ¡ Interval ¡tree ¡ PosBng ¡list ¡ ¡ Corpus ¡Layers ¡ Hash ¡Table ¡ ¡

168M+4.7G ¡ 779M ¡ 331M+6.8G ¡ 135M ¡ 3.7G ¡ 54M ¡ 321M+7.5G ¡ 130M ¡ 1.5G ¡(tags) ¡

slide-6
SLIDE 6

What ¡is ¡MapReduce? ¡ ¡

  • A ¡widely ¡used ¡parallel ¡compuBng ¡model ¡
  • For ¡batch ¡processing ¡of ¡data ¡on ¡terabyte ¡or ¡petabyte ¡scales ¡
  • On ¡clusters ¡of ¡commodity ¡servers ¡(typically) ¡
  • Fault ¡tolerance: ¡task ¡monitoring ¡and ¡replicaBon ¡
  • Abstracts ¡parallelizaBon, ¡synchronizaBon ¡and ¡communicaBon ¡
  • Hadoop ¡is ¡the ¡most ¡popular ¡MapReduce ¡scale ¡out ¡implementaBon ¡ ¡

¡

6 ¡

slide-7
SLIDE 7

Hadoop ¡MapReduce ¡ ¡

¡ ¡

7 ¡

Map(k1, ¡v1) ¡-­‑> ¡list(k2, ¡v2) ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡Reduce(k2, ¡list(v2)) ¡-­‑> ¡list(v2) ¡

slide-8
SLIDE 8

Scaling ¡out ¡vs ¡Scaling ¡up ¡Dilemma ¡ ¡

  • Scaling ¡out ¡(horiz.) ¡

– Cluster ¡of ¡commodity ¡servers ¡ ¡ ¡ ¡ – Pros: ¡

  • Cheaper ¡
  • Fault ¡tolerance ¡
  • Easy ¡to ¡update ¡

– Cons: ¡

  • Power ¡consumpBon ¡
  • Cooling ¡
  • Space ¡
  • Difficult ¡to ¡implement ¡
  • Networking ¡equipment ¡
  • Licensing ¡costs ¡
  • Scaling ¡up ¡(vert.) ¡

– Powerful ¡server ¡(+proc./+RAM) ¡ – Pros: ¡

  • Power ¡consumpBon ¡
  • Cooling ¡
  • Space ¡
  • Easy ¡to ¡implement ¡
  • Networking ¡equip. ¡~ ¡0 ¡
  • Licensing ¡costs ¡ ¡

– Cons: ¡

  • Expensive ¡
  • Fault ¡tolerance ¡
  • Difficult ¡to ¡update ¡

8 ¡

slide-9
SLIDE 9

Scaling ¡out ¡vs ¡Scaling ¡up ¡Dilemma ¡ ¡

  • Appuswamy ¡& ¡al. ¡(2014) ¡ ¡“Scale-­‑up ¡vs ¡Scale-­‑out ¡for ¡Hadoop: ¡Time ¡

to ¡rethink?” ¡In ¡Proc. ¡4th ¡Ann. ¡Symp. ¡on ¡Cloud ¡CompuFng. ¡

  • Input ¡size ¡in ¡analyBcs ¡producBon ¡clusters: ¡ ¡

– Microsot ¡/ ¡Yahoo: ¡median ¡< ¡14 ¡Gb, ¡Facebook: ¡90% ¡< ¡100 ¡Gb ¡

  • Conclusion: ¡ ¡

– “Scaling ¡up ¡is ¡more ¡cost-­‑effec-ve ¡for ¡many ¡real-­‑word ¡problems” ¡

¡

9 ¡

50%, ¡< ¡14 ¡Gb ¡

slide-10
SLIDE 10

Scaling ¡up ¡with ¡Phoenix++ ¡MapReduce ¡ ¡

10 ¡

"Phoenix++: ¡Modular ¡MapReduce ¡for ¡Shared-­‑Memory ¡Systems", ¡2011: ¡JusBn ¡Talbot, ¡Richard ¡M. ¡Yoo, ¡and ¡ Christos ¡Kozyrakis. ¡Second ¡InternaFonal ¡Workshop ¡on ¡MapReduce ¡and ¡its ¡ApplicaFons. ¡ ¡ (Code: ¡hyp://mapreduce.stanford.edu) ¡ ¡

  • Split: ¡divides ¡input ¡data ¡to ¡chunks ¡for ¡map ¡tasks ¡
  • Combiner: ¡are ¡thread-­‑local ¡objects ¡ ¡
  • Map: ¡invokes ¡the ¡Combiner ¡for ¡each ¡key-­‑value ¡pair ¡emiyed ¡(not ¡at ¡the ¡end ¡of ¡Map) ¡
  • ParBBon/Suffle: ¡not ¡in ¡Phoenix++ ¡
  • Reduce: ¡aggregates ¡key-­‑value ¡pairs ¡in ¡Combiners ¡(All ¡Map ¡task ¡are ¡finished) ¡
  • Merge: ¡sort ¡key-­‑value ¡pairs ¡(opBonal ¡phase) ¡
  • Problems: ¡introduces ¡rehash ¡between ¡map ¡and ¡reduce ¡phases ¡
slide-11
SLIDE 11

Experiments: ¡Data ¡& ¡Machinery ¡ ¡

  • Base ¡Corpus ¡

– Elpais.com ¡on-­‑line ¡archive ¡(1976–2011) ¡ – 2.3 ¡million ¡news ¡ ¡ – Cleaned ¡+ ¡PoS ¡tagged ¡ – 23 ¡million ¡structural ¡elements ¡ – 878 ¡million ¡tokens ¡

  • MulBples ¡of ¡Elpais.com ¡

– x2, ¡x4, ¡x8, ¡x16 ¡ – Don’t ¡obey ¡Heaps’ ¡Law ¡(V(n) ¡= ¡K·√nβ) ¡

  • 1x ¡Dell ¡PowerEdge ¡R615 ¡

– RAM: ¡256 ¡Gb ¡ – CPUs: ¡2 ¡x ¡Xeon ¡E5-­‑2620 ¡/ ¡2 ¡GHz ¡(24 ¡threads) ¡ – DISKS: ¡3 ¡x ¡SAS ¡7.200 ¡rpm, ¡RAID-­‑5 ¡ ¡

¡

11 ¡

500000 1e+06 1.5e+06 2e+06 2.5e+06 3e+06 3.5e+06 4e+06 4.5e+06 5e+08 1e+09 1.5e+09 2e+09 Types Tokens

slide-12
SLIDE 12

Word ¡CounBng ¡

Given ¡a ¡(sub-­‑)corpus, ¡ ¡ compute ¡the ¡frequencies ¡ ¡

  • f ¡all ¡the ¡words ¡

(word ¡frequency ¡profile) ¡

12 ¡

slide-13
SLIDE 13

Word ¡CounBng ¡

13 ¡

Map(<doc, ¡begin, ¡end>) ¡= ¡ ¡ ¡ ¡for ¡i ¡= ¡begin ¡to ¡end ¡do ¡ ¡ ¡ ¡ ¡ ¡ ¡emit(words[docs[doc].offset ¡+ ¡i], ¡1) ¡ ¡ ¡ ¡end ¡ Split(docs) ¡= ¡ ¡ ¡ ¡divide ¡docs ¡into ¡<doc, ¡begin, ¡end> ¡ Combiner: ¡

¡ ¡

Word ¡

  • Freq. ¡

0 ¡(la) ¡ 456 ¡ 19 ¡(de) ¡ 5667 ¡ … ¡ … ¡

… ¡

slide-14
SLIDE 14

Word ¡CounBng ¡

5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 1e+09 2e+09 3e+09 4e+09 5e+09 6e+09 7e+09 8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0 ¡s ¡-­‑> ¡6.2 ¡s ¡ 8 ¡threads ¡-­‑> ¡16 ¡threads ¡ 1.5 ¡s ¡-­‑> ¡1.0 ¡s ¡

slide-16
SLIDE 16

Word ¡Cooccurrencies ¡

Given ¡a ¡word ¡(or ¡a ¡lema ¡or ¡a ¡PoS, ¡…), ¡ compute ¡the ¡frequency ¡of ¡the ¡ ¡ surrounding ¡words ¡(let/right) ¡

16 ¡

slide-17
SLIDE 17

Word ¡Cooccurrences ¡ ¡

17 ¡

Map(<doc, ¡n, ¡pos>) ¡= ¡ ¡ ¡ ¡for ¡i ¡= ¡0 ¡to ¡n ¡-­‑ ¡1 ¡do ¡ ¡ ¡ ¡ ¡ ¡ ¡for ¡j ¡= ¡1 ¡to ¡L ¡do ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡emit(words[docs[doc].offset ¡+ ¡pos[i] ¡-­‑ ¡j], ¡1) ¡ ¡ ¡ ¡ ¡ ¡ ¡end ¡ ¡ ¡ ¡ ¡ ¡ ¡for ¡j ¡= ¡1 ¡to ¡R ¡do ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡emit(words[docs[doc].offset ¡+ ¡pos[i] ¡+ ¡j], ¡1) ¡ ¡ ¡ ¡ ¡ ¡ ¡end ¡ ¡ ¡ ¡end ¡ Split(PosBng ¡list) ¡= ¡ ¡ ¡ ¡divide ¡the ¡posBng ¡list ¡into ¡<doc, ¡n, ¡posiBons> ¡ Combiner: ¡

¡ ¡

Word ¡

  • Freq. ¡

0 ¡(la) ¡ 456 ¡ 19 ¡(de) ¡ 5667 ¡ … ¡ … ¡ Let ¡ Context ¡ Right ¡ Context ¡

…... ¡ …… ¡

  • ­‑L ¡
  • ­‑1 ¡
  • ­‑2 ¡

+1 ¡ +2 ¡ +R ¡

slide-18
SLIDE 18

Word ¡Cooccurrences ¡

  • f ¡[token ¡= ¡“de”] ¡in ¡Elpais.com ¡x1 ¡=> ¡55.7 ¡Millions ¡

1 2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¡ R=10 ¡

slide-20
SLIDE 20

N-­‑grams ¡

Given ¡a ¡(sub-­‑)corpus, ¡ compute ¡the ¡frequency ¡of ¡all ¡the ¡sequences ¡of ¡ words ¡(lemma, ¡PoS, ¡…) ¡ ¡with ¡lengths ¡between ¡a ¡ minimum ¡and ¡a ¡maximum ¡

20 ¡

slide-21
SLIDE 21

MapReduce ¡N-­‑grams ¡ The ¡Suffix-­‑σ ¡Algorithm ¡ ¡

  • Klaus ¡Berberich ¡and ¡Srikanta ¡Bedathur ¡(2013): ¡“CompuBng ¡n-­‑Gram ¡

StaBsBcs ¡in ¡MapReduce”. ¡In ¡Proceedings ¡of ¡16th ¡InternaFonal ¡ Conference ¡on ¡Extending ¡Database ¡Technology ¡(EDBT ¡2013) ¡

– Stage ¡1: ¡Maximal ¡n-­‑gram ¡counts ¡are ¡computed ¡and ¡sorted ¡ ¡ – Stage ¡2: ¡Shorter ¡n-­‑gram ¡counts ¡are ¡computed ¡from ¡the ¡suffix ¡array ¡of ¡ maximal ¡n-­‑grams ¡in ¡the ¡reducer ¡tasks ¡

  • New ¡York ¡Times ¡Annotated ¡Corpus ¡(NYT) ¡

– 1.8 ¡million ¡newspaper ¡arBcles, ¡1987-­‑2007, ¡~3 ¡Gb ¡ – 1 ¡billion ¡tokens ¡(345,827 ¡types) ¡

  • ClueWeb09-­‑B ¡(CW) ¡

– 50 ¡million ¡web ¡documents, ¡2009, ¡~246 ¡Gb ¡ ¡ – ~21 ¡billion ¡tokens ¡(979,935 ¡types) ¡

  • Hadoop ¡Cluster: ¡10 ¡nodes ¡

– 2x6 ¡cores, ¡64 ¡Gb ¡RAM, ¡4x2 ¡Tb ¡HDD ¡

21 ¡

2-­‑5-­‑grams ¡/ ¡min ¡freq.=10 ¡(NYT), ¡100 ¡(CW) ¡ ¡

slide-22
SLIDE 22

MapReduce ¡N-­‑grams ¡ ¡

22 ¡

Map(<doc, ¡begin, ¡end>) ¡= ¡ ¡ ¡ ¡for ¡pos ¡= ¡begin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¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡10 ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡15 ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡20 ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡25 ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡30 ¡ ¡ ¡ ¡ Sample ¡Size ¡(million ¡tokens) ¡

3 ¡min ¡

2-­‑5-­‑grams ¡/ ¡min ¡freq.=10 ¡(NYT), ¡100 ¡(CW) ¡ ¡

Problems ¡with ¡the ¡ hash ¡table ¡combiner ¡

slide-24
SLIDE 24

MapReduce ¡into ¡the ¡Indexer: ¡ File ¡Inversion ¡

  • Text ¡inversion ¡
  • Structural ¡inversion ¡

¡

24 ¡

slide-25
SLIDE 25

MapReduce ¡File ¡Inversion ¡ Text ¡Indexing ¡

25 ¡

Key ¡ Aggregated ¡ value ¡ Key ¡ Value ¡ Doc1 ¡ Doc2 ¡

slide-26
SLIDE 26

MapReduce ¡File ¡Inversion: ¡ Indexing ¡Structure ¡

26 ¡

Emiyed ¡ tree ¡value ¡ for ¡key ¡k ¡ Emiyed ¡ tree ¡value ¡ ¡ for ¡key ¡k ¡ Aggregated ¡ tree ¡ Time(Join(T1, ¡T2)) ¡= ¡O(max(h1, ¡h2)) ¡= ¡O(max(log(n1, ¡n2))) ¡ ¡

slide-27
SLIDE 27

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