Martin Haase: Linguistic Hacking [24c3]

37
Linguistic Hacking [email protected] [email protected] How to know what a text in an unknown language is about? 1

description

A presentation by Martin Haase at the 24th Chaos Communication Congress, Berlin, December 2007. http://events.ccc.de/congress/2007/Fahrplan/events/2284.en.html http://www.youtube.com/watch?v=M3TYMmKxbqA http://lanyrd.com/scgypk

Transcript of Martin Haase: Linguistic Hacking [24c3]

Page 1: Martin Haase: Linguistic Hacking [24c3]

Linguistic Hacking

[email protected]@jabber.ccc.de

How to know what a text in an unknown language is about?

1

Page 2: Martin Haase: Linguistic Hacking [24c3]

Contents

• how to identify the language of a written text

• in traditional ways,

• with the help of computer technology.

• how to get at least some information out of an unknown text.

2

Page 3: Martin Haase: Linguistic Hacking [24c3]

“the intellectual challenge of creatively overcoming or circumventing limitations.”

Hacking

Eric Raymond (1996): The New Hackerʼs

Dictionary.

3

Page 4: Martin Haase: Linguistic Hacking [24c3]

Spoken texts?

multi-language corpus of telephone calls

4

Page 5: Martin Haase: Linguistic Hacking [24c3]

Writing Systems• Roman (thousands of languages)

• Cyrillic (> 60 languages)

• Arabic (> 20 languages)

• Devana̅garī (> 10 languages, not counting derivative writing systems)

• Hebrew (~ 3 – 5 languages)

5

Page 6: Martin Haase: Linguistic Hacking [24c3]

Devanāgarī

!वनागरी

6

Page 7: Martin Haase: Linguistic Hacking [24c3]

7

Page 8: Martin Haase: Linguistic Hacking [24c3]

8

Page 9: Martin Haase: Linguistic Hacking [24c3]

9

Page 10: Martin Haase: Linguistic Hacking [24c3]

10

Page 11: Martin Haase: Linguistic Hacking [24c3]

Hebrew

• Old and Modern Hebrew,

• Ladino (with different varieties),

• Judeo-Arabic,

• Yiddish.

11

Page 12: Martin Haase: Linguistic Hacking [24c3]

12

Page 13: Martin Haase: Linguistic Hacking [24c3]

13

Page 14: Martin Haase: Linguistic Hacking [24c3]

Norman C. Ingle (1980): Language Identification

Table. London: Technical Translation International.

14

Page 15: Martin Haase: Linguistic Hacking [24c3]

15

Page 16: Martin Haase: Linguistic Hacking [24c3]

Computer-aided identification

• frequencies of unique characters and character strings

• common words recognition

• n-gram analysis

16

Page 17: Martin Haase: Linguistic Hacking [24c3]

“Text”

17

Page 18: Martin Haase: Linguistic Hacking [24c3]

( TE), (TEX), (EXT), (XT )

18

Page 19: Martin Haase: Linguistic Hacking [24c3]

19

Page 20: Martin Haase: Linguistic Hacking [24c3]

variant of the unique character string approach

20

Page 21: Martin Haase: Linguistic Hacking [24c3]

compression efficiency

21

Page 22: Martin Haase: Linguistic Hacking [24c3]

reference model

22

Page 23: Martin Haase: Linguistic Hacking [24c3]

reference model

text in language to be identified+

23

Page 24: Martin Haase: Linguistic Hacking [24c3]

reference model

text in language to be identified+

gzip

24

Page 25: Martin Haase: Linguistic Hacking [24c3]

reference model

text in language to be identified+

gzip

compression efficiency

25

Page 26: Martin Haase: Linguistic Hacking [24c3]

Interesting applications

• measuring linguistic difference > language families

• determining types of text

• spam detection?

26

Page 27: Martin Haase: Linguistic Hacking [24c3]

• TextCat (http://odur.let.rug.nl/vannoord/TextCat/Demo/), n-gram based, 76 languages, usable as a web application,

• Languid (http://languid.cantbedone.org/), downloadable program, web application not running,

• Langid (http://complingone.georgetown.edu/∼langid/), n-gram based, 65 languages, web application,

• LanguageGuesser (http://www.xrce.xerox.com/cgi-bin/mltt/LanguageGuesser), frequency tests on characters and character sequences, about 40 languages, web application,

• Polyglot 3000 (http://www.polyglot3000.com/), corpora, method unknown, currently 441 languages, closed-source Windows freeware. :-(

27

Page 28: Martin Haase: Linguistic Hacking [24c3]

approaching “content analysis”

28

Page 29: Martin Haase: Linguistic Hacking [24c3]

Hackerʼs approach• numbers, dates, words from another

language

• typographic hints:

• bold or italic print,

• colored or underlined text chunks,

• capital letters

29

Page 30: Martin Haase: Linguistic Hacking [24c3]

Zipfʼs law

Very frequent words are shorter and contain less lexical information, whereas infrequent words are

longer and contain more lexical information.

30

Page 31: Martin Haase: Linguistic Hacking [24c3]

less lexical information implies more grammatical information and vice versa

31

Page 32: Martin Haase: Linguistic Hacking [24c3]

most interesting for us: words with more specific lexical information

32

Page 33: Martin Haase: Linguistic Hacking [24c3]

Ignore all short words! (even if they reiterate throughout the text)

33

Page 34: Martin Haase: Linguistic Hacking [24c3]

Ua salalau lenei gagana i le lalolagi atoa. ‘O lenei fo‘i gagana, ‘ua ‘avea ma gagana lona lua a le tele o tagata ‘o le vasa Pasefika, e pei ‘o Samoa. E iai le manatu, ‘o le gagana fa‘aperetania, ‘ua matua̅ talitonu i ai le tele o tagata Samoa e fa‘apea ‘o le gagana e maua ai le atamai ma le poto. ‘E talitonu fo‘i nisi o i latou, ‘e le̅ aoga la latou gagana. E le̅ sa‘o lea ta̅ofi, ‘aua̅ e ‘avatu le gagana fa‘aperetania i Samoa, ‘ua leva ona atamamai ma popoto tagata Samoa e fai lo latou soifua ma lo latou lalolagi.

34

Page 35: Martin Haase: Linguistic Hacking [24c3]

Ua salalau lenei gagana i le lalolagi atoa. ‘O lenei fo‘i gagana, ‘ua ‘avea ma gagana lona lua a le tele o tagata ‘o le vasa Pasefika, e pei ‘o Samoa. E iai le manatu, ‘o le gagana fa‘aperetania, ‘ua matua̅ talitonu i ai le tele o tagata Samoa e fa‘apea ‘o le gagana e maua ai le atamai ma le poto. ‘E talitonu fo‘i nisi o i latou, ‘e le̅ aoga la latou gagana. E le̅ sa‘o lea ta̅ofi, ‘aua̅ e ‘avatu le gagana fa‘aperetania i Samoa, ‘ua leva ona atamamai ma popoto tagata Samoa e fai lo latou soifua ma lo latou lalolagi.

35

Page 36: Martin Haase: Linguistic Hacking [24c3]

Ua salalau lenei gagana i le lalolagi atoa. ‘O lenei fo‘i gagana, ‘ua ‘avea ma gagana lona lua a le tele o tagata ‘o le vasa Pasefika, e pei ‘o Samoa. E iai le manatu, ‘o le gagana fa‘aperetania, ‘ua matua̅ talitonu i ai le tele o tagata Samoa e fa‘apea ‘o le gagana e maua ai le atamai ma le poto. ‘E talitonu fo‘i nisi o i latou, ‘e le̅ aoga la latou gagana. E le̅ sa‘o lea ta̅ofi, ‘aua̅ e ‘avatu le gagana fa‘aperetania i Samoa, ‘ua leva ona atamamai ma popoto tagata Samoa e fai lo latou soifua ma lo latou lalolagi.

36

Page 37: Martin Haase: Linguistic Hacking [24c3]

Ua salalau lenei gagana i le lalolagi atoa. ‘O lenei fo‘i gagana, ‘ua ‘avea ma gagana lona lua a le tele o tagata ‘o le vasa Pasefika, e pei ‘o Samoa. E iai le manatu, ‘o le gagana fa‘aperetania, ‘ua matua̅ talitonu i ai le tele o tagata Samoa e fa‘apea ‘o le gagana e maua ai le atamai ma le poto. ‘E talitonu fo‘i nisi o i latou, ‘e le̅ aoga la latou gagana. E le̅ sa‘o lea ta̅ofi, ‘aua̅ e ‘avatu le gagana fa‘aperetania i Samoa, ‘ua leva ona atamamai ma popoto tagata Samoa e fai lo latou soifua ma lo latou lalolagi.

37