+ All Categories
Home > Documents > Language and Computers - Prologue: Encoding Language

Language and Computers - Prologue: Encoding Language

Date post: 28-Jan-2022
Category:
Upload: others
View: 4 times
Download: 0 times
Share this document with a friend
60
Language and Computers Prologue: Encoding Language Writing systems Alphabetic Syllabic Logographic Systems with unusual realization Relation to language Encoding written language ASCII Unicode Spoken language Transcription Why speech is hard to represent Articulation Measuring sound Acoustics Relating written and spoken language From Speech to Text From Text to Speech Language modeling Language and Computers Prologue: Encoding Language Based on Dickinson, Brew, & Meurers (2013) 1 / 60
Transcript

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

Language and ComputersPrologue: Encoding Language

Based on Dickinson, Brew, & Meurers (2013)

1 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

Language and Computers – where to start?

I If we want to do anything with language, we need a wayto represent language.

I We can interact with the computer in several ways:I write or read textI speak or listen to speech

I Computer has to have some way to representI textI speech

2 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

Outline

Writing systems

Encoding written language

Spoken language

Relating written and spoken language

Language modeling

3 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

Writing systems used for human languages

What is writing?

“a system of more or less permanent marks usedto represent an utterance in such a way that it canbe recovered more or less exactly without theintervention of the utterer.”(Peter T. Daniels, The World’s Writing Systems)

Different types of writing systems are used:

I AlphabeticI SyllabicI Logographic

Much of the information on writing systems and the graphics used aretaken from the great site http://www.omniglot.com.

4 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

Alphabetic systems

Alphabets (phonemic alphabets)

I represent all sounds, i.e., consonants and vowelsI Examples: Etruscan, Latin, Korean, Cyrillic, Runic,

International Phonetic Alphabet

Abjads (consonant alphabets)

I represent consonants only (sometimes plus selectedvowels; vowel diacritics generally available)

I Examples: Arabic, Aramaic, Hebrew

5 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

Alphabet example: Fraser

An alphabet used to write Lisu, a Tibeto-Burman language spoken by

about 657,000 people in Myanmar, India, Thailand and in the Chinese

provinces of Yunnan and Sichuan.

(from: http://www.omniglot.com/writing/fraser.htm)

6 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

Abjad example: Phoenician

An abjad used to write Phoenician, created between the 18th and 17th

centuries BC; assumed to be the forerunner of the Greek and Hebrew

alphabet.

(from: http://www.omniglot.com/writing/phoenician.htm)

7 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

A note on the letter-sound correspondence

I Alphabets use letters to encode sounds (consonants,vowels).

I But the correspondence between spelling andpronunciation in many languages is quite complex, i.e.,not a simple one-to-one correspondence.

I Example: EnglishI same spelling – different sounds: ough: ought, cough,

tough, through, though, hiccoughI silent letters: knee, knight, knife, debt, psychology,

mortgageI one letter – multiple sounds: exit, useI multiple letters – one sound: the, revolutionI alternate spellings: jail or gaol; but not possible seagh

for chef (despite sure, dead, laugh)

8 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

More examples for non-transparent letter-soundcorrespondences

French

(1) a. Versailles→ [veRsai]

b. ete, etais, etait, etaient → [ete]

Irish

(2) a. samhradh (summer)→ [sauruh]

b. scri’obhaim (I write)→ [shgri:m]

What is the notation used within the []?

9 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

The International Phonetic Alphabet (IPA)

I Several special alphabets for representing sounds havebeen developed, the best known being the InternationalPhonetic Alphabet (IPA).

I The phonetic symbols are unambiguous:I designed so that each speech sound gets its own

symbol,I eliminating the need for

I multiple symbols used to represent simple soundsI one symbol being used for multiple sounds.

I Interactive example chart: http://web.uvic.ca/ling/resources/ipa/charts/IPAlab/IPAlab.htm

10 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

Syllabic systems

Abugidas (Alphasyllabaries)

I writing systems organized into familiesI symbols represent a consonant with a vowel, but the

vowel can be changed by adding a diacritic (= asymbol added to the letter).

I Examples: Balinese, Javanese, Tamil, Thai, Tagalog(cf. also: http://www.omniglot.com/writing/syllabic.htm)

Syllabaries

I writing systems with separate symbols for each syllableof a language

I Examples: Cherokee. Ethiopic, Cypriot, Ojibwe,Hiragana (Japanese)(cf. also: http://www.omniglot.com/writing/syllabaries.htm#syll)

11 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

Syllabary example: Cypriot

The Cypriot syllabary or Cypro-Minoan writing is thought to have

developed from the Linear A, or possibly the Linear B script of Crete,

though its exact origins are not known. It was used from about 800 to 200

BC.

(from: http://www.omniglot.com/writing/cypriot.htm)

12 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

Abugida example: Lao

Script developed in the 14th century to write the Lao language, based on

an early version of the Thai script, which was developed from the Old

Khmer script, which was itself based on Mon scripts.

Example for vowel diacritics around the letter k:

(from: http://www.omniglot.com/writing/lao.htm)

13 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

Logographic writing systems

I Logographs (also called Logograms):I Pictographs (Pictograms): originally pictures of

things, now stylized and simplified.

Example: development of Chinese character horse:

I Ideographs (Ideograms): representations of abstractideas

I Compounds: combinations of two or more logographs.I Semantic-phonetic compounds: symbols with a

meaning element (hints at meaning) and a phoneticelement (hints at pronunciation).

I Examples: Chinese (Zhongwen), Japanese (Nihongo),Mayan, Vietnamese, Ancient Egyptian

14 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

Logograph writing system example: Chinese

Pictographs

Ideographs

Compounds of Pictographs/Ideographs

(from: http://www.omniglot.com/writing/chinese types.htm)

15 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

Semantic-phonetic compounds

An example from Ancient Egyptian

(from: http://www.omniglot.com/writing/egyptian.htm)16 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

Two writing systems with unusual realization

Tactile

I Braille is a writing system that makes it possible to readand write through touch; primarily used by the (partially)blind.

I It uses patterns of raised dots arranged in cells of up tosix dots in a 3 x 2 configuration.

I Each pattern represents a character, but some frequentwords and letter combinations have their own pattern.

Chromatographic

I The Benin and Edo people in southern Nigeria havesupposedly developed a system of writing based ondifferent color combinations and symbols.

(cf. http://www.library.cornell.edu/africana/Writing Systems/Chroma.html)

17 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

Braille alphabet

18 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

Chromatographic system

19 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

Relating writing systems to languages

I There is not a simple correspondence between awriting system and a language.

I For example, English uses the Roman alphabet, butArabic numerals (e.g., 3 and 4 instead of III and IV).

I We’ll look at three other examples:I JapaneseI KoreanI Azeri

20 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

Japanese

Japanese: logographic system kanji, syllabary katakana,syllabary hiragana

I kanji: 5,000-10,000 borrowed Chinese charactersI katakana

I used mainly for non-Chinese loan words, onomatopoeicwords, foreign names, and for emphasis

I hiraganaI originally used only by women (10th century), but

codified in 1946 with 48 syllablesI used mainly for word endings, kids’ books, and for

words with obscure kanji symbols

I romaji: Roman characters

21 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

Korean

I The hangul system was developed in 1444 during KingSejong’s reign.

I There are 24 letters: 14 consonants and 10 vowelsI But the letters are grouped into syllables, i.e. the letters

in a syllable are not written separately as in the Englishsystem, but together form a single character.E.g., “Hangeul” (from: http://www.omniglot.com/writing/korean.htm):

I In South Korea, hanja (logographic Chinese characters)are also used.

22 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

Azeri

A Turkish language with speakers in Azerbaijan, northwestIran, and (former Soviet) Georgia

I 7th century until 1920s: Arabic scripts. Three differentArabic scripts used

I 1929: Latin alphabet enforced by Soviets to reduceIslamic influence.

I 1939: Cyrillic alphabet enforced by StalinI 1991: Back to Latin alphabet, but slightly different than

before.

23 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

Encoding written language

I Information on a computer is stored in bits.I A bit is either on (= 1, yes) or off (= 0, no).I A list of 8 bits makes up a byte, e.g., 01001010I Just like with the base 10 numbers we’re used to, the

order of the bits in a byte matters:I Big Endian: most important bit is leftmost (the standard

way of doing things)I The positions in a byte thus encode:

128 64 32 16 8 4 2 1I “There are 10 kinds of people in the world; those who

know binary and those who don’t”

I Little Endian: most important bit is rightmost (onlyused on Intel machines)

I The positions in a byte thus encode:1 2 4 8 16 32 64 128

24 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

Converting decimal numbers to binaryTabular Method

Using the first 4 bits, we want to know how to write 10 in bit(or binary) notation.

8 4 2 1? ? ? ?8 < 10 ? ? ?1 8 + 4 = 12 > 10 ? ?1 0 8 + 2 = 10 ?1 0 1 0

25 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

Converting decimal numbers to binaryDivision Method

Decimal Remainder? Binary10/2 = 5 no 05/2 = 2 yes 102/2 = 1 no 0101/2 = 0 yes 1010

26 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

An encoding standard: ASCII

With 8 bits (a single byte), you can represent 256 differentcharacters.

I With 256 possible characters, we can store:I every single letter used in English,I plus all the things like commas, periods, space bar,

percent sign (%), back space, and so on.

ASCII = the American Standard Code for InformationInterchange

I 7-bit code for storing English textI 7 bits = 128 possible characters.I The numeric order reflects alphabetic ordering.

27 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

The ASCII chart

Codes 1–31 are used for control characters (backspace, linefeed, tab, . . . ).

3233 !34 “35 #36 $37 %38 &39 ’40 (41 )42 *43 +44 ,45 -46 .47 /

48 049 150 251 352 453 554 655 756 857 958 :59 ;60 <

61 =62 >

63 ?64 @

65 A66 B67 C68 D69 E70 F71 G72 H73 I74 J75 K76 L77 M78 N79 O80 P81 Q

82 R83 S84 T85 U86 V87 W88 X89 Y90 Z91 [92 \

93 ]94 ^

95 _

96 ‘

97 a98 b99 c100 d101 e102 f103 g104 h105 i106 j107 k108 l109 m110 n111 o112 p113 q

114 r115 s116 t117 u118 v119 w120 x121 y122 z123 {124 —125 }126 ˜127 DEL

28 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

E-mail issues

I Mail sent on the internet used to only be able to transferthe 7-bit ASCII messages. But now we can detect theincoming character set and adjust the input.

I Note that this is an example of meta-information =information which is printed as part of the regularmessage, but tells us something about that message.

I Multipurpose Internet Mail Extensions (MIME) providesmeta-information on the text, which tells us:

I which version of MIME is being usedI what the charcter set isI if that character set was altered, how it was altered

Mime-Version: 1.0 Content-Type: text/plain;

charset=US-ASCII Content-Transfer-Encoding: 7bit

29 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

Different coding systems

But wait, didn’t we want to be able to encode all languages?

There are ways ...

I Extend the ASCII system with various other systems,for example:

I ISO 8859-1: includes extra letters needed for French,German, Spanish, etc.

I ISO 8859-7: Greek alphabetI ISO 8859-8: Hebrew alphabetI JIS X 0208: Japanese characters

I Have one system for everything→ Unicode

30 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

Unicode

Problems with having multiple encoding systems:

I Conflicts: two encodings can use:I same number for two different charactersI different numbers for the same character

I Hassle: have to install many, many systems if you wantto be able to deal with various languages

Unicode tries to fix that by having a single representation forevery possible character.

“Unicode provides a unique number for everycharacter, no matter what the platform, no matterwhat the program, no matter what the language.”(www.unicode.org)

31 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

How big is Unicode?

Version 6.2 has codes for 110,117 characters fromalphabets, syllabaries and logographic systems.

I Uses 32 bits – meaning we can store232 = 4, 294, 967, 296 characters.

I 4 billion possibilities for each character? That takes a lotof space on the computer!

32 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

Compact encoding of Unicode characters

I Unicode has three versionsI UTF-32 (32 bits): direct representationI UTF-16 (16 bits): 216 = 65536I UTF-8 (8 bits): 28 = 256

I How is it possible to encode 232 possibilities in 8 bits(UTF-8)?

I Several bytes are used to represent one character.I Use the highest bit as flag:

I highest bit 0: single characterI highest bit 1: part of a multi byte character

I Nice consequence: ASCII text is in a valid UTF-8encoding.

33 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

UTF-8 details

I First byte unambiguously tells you how many bytes toexpect after it

I e.g., first byte of 11110xxx has a four total bytesI all non-starting bytes start with 10 = not the initial byte

Byte 1 Byte 2 Byte 3 Byte 4 Byte 5 Byte 60xxxxxxx110xxxxx 10xxxxxx1110xxxx 10xxxxxx 10xxxxxx11110xxx 10xxxxxx 10xxxxxx 10xxxxxx111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx

Example: Greek α (‘alpha’) has a code value of 945I Binary: 11 10110001I 11 10110001 = 011 10110001 = 01110 110001I Insert these numbers into x ’s in the second row:

11001110 1011000134 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

Information Theory(if time)

This idea of getting the shortest encoding first comes frominformation theoryI Goal: encode information using the smallest number of

bitsI We can look at a few examples here:

http://www.cs.cmu.edu/∼dst/Tutorials/Info-Theory/(Focus on Variable Length Codes & don’t worry about allthe details)

We’ll revisit this issue with writers’ aids, when we discuss thenoisy channel model

35 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

Unwritten languages

Many languages have never been written down. Of the 6912spoken languages, approximately 3000 have never beenwritten down.

Some examples:

I Salar, a Turkic language in China.I Gugu Badhun, a language in Australia.I Southeastern Pomo, a language in California

(See: http://www.ethnologue.com/ and http://www.sil.org/mexico/ilv/iinfoilvmexico.htm)

36 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

The need for speech

We want to be able to encode any spoken language

I What if we want to work with an unwritten language?I What if we want to examine the way someone talks and

don’t have time to write it down?

Many applications for encoding speech:I Building spoken dialogue systems, i.e. speak with a

computer (and have it speak back).I Helping people sound like native speakers of a foreign

language.I Helping speech pathologists diagnose problems

37 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

What does speech look like?

We can transcribe (write down) the speech into a phoneticalphabet.

I It is very expensive and time-consuming to havehumans do all the transcription.

I To automatically transcribe, we need to know how torelate the audio file to the individual sounds that wehear.⇒We need to know:

I some properties of speechI how to measure these speech propertiesI how these measurements correspond to sounds we

hear

38 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

What makes representing speech hard?

Sounds run together, and it’s hard to tell where one soundends and another begins.

People say things differently from one another:I People have different dialectsI People have different size vocal tracts

People say things differently across time:I What we think of as one sound is not always (usually)

said the same: coarticulation = sounds affecting theway neighboring sounds are said

e.g. k is said differently depending on if it is followed by ee orby oo.

I What we think of as two sounds are not always all thatdifferent.

e.g. The s in see is acoustically similar to the sh in shoe

39 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

Articulatory properties: How it’s produced

We could talk about how sounds are produced in the vocaltract, i.e. articulatory phonetics

I place of articulation (where): [t] vs. [k]I manner of articulation (how): [t] vs. [s]I voicing (vocal cord vibration): [t] vs. [d]

But we need to know acoustic properties of speech whichwe can quantify.

40 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

Measuring sound

sampling rate = how many times in a given second weextract a moment of sound; measured in samples persecond

I Sound is continuous, but we have to store data in adiscrete manner.

CONTINUOUS DISCRETE

I We store data at each discrete point, in order to capturethe general pattern of the sound

Now, we can talk about what we need to measure

41 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

Acoustic properties: What it sounds like

Sound waves = “small variations in air pressure that occurvery rapidly one after another” (Ladefoged, A Course inPhonetics), akin to ripples in a pond

The main properties we measure:I speech flow = rate of speaking, number and length of

pauses (seconds)I loudness (amplitude) = amount of energy (decibels)I frequencies = how fast the sound waves are repeating

(cycles per second, i.e. Hertz)I pitch = how high or low a sound isI In speech, there is a fundamental frequency, or pitch,

along with higher-frequency overtones.

Researchers also look at things like intonation, i.e., the riseand fall in pitch

42 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

Oscillogram (Waveform)

Time (s)0 1.263

0

5000

Freq

uenc

y (H

z)

θ ɜ ɹ z d eɪ

Time (s)0 1.263

43 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

Spectrograms

Spectrogram = a graph to represent (the frequencies of)speech over time.

Time (s)0 1.263

0

5000

Freq

uenc

y (H

z)

0

1000

2000

3000

4000

5000

zθ ɜ ɹ d eɪ

44 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

Measurement-souund correspondence

I How dark is the picture? → How loud is the sound?I We can measure this in decibels.

I Where are the lines the darkest? →Which frequenciesare the loudest and most important?

I We can measure this in terms of Hertz, and it tells uswhat the vowels are.

I How do these dark lines change? → How are thefrequencies changing over time?

I Which consonants are we transitioning into?

45 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

Applications of speech encoding

Mapping sounds to symbols (alphabet), and vice versa, hassome very practical uses.

I Automatic Speech Recognition (ASR): sounds to textI Text-to-Speech Synthesis (TTS): texts to sounds

As we’ll see, these are not easy tasks.

46 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

Automatic Speech Recognition (ASR)

Automatic speech recognition = process by which thecomputer maps a speech signal to text.

Uses/Applications:

I DictationI Dialogue systemsI Telephone conversationsI People with disabilities – e.g. automatic closed

captioning

47 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

Steps in an ASR system

1. Digital sampling of speech

2. Acoustic signal processing = converting the speechsamples into particular measurable units

3. Recognition of sounds, groups of sounds, and words

May or may not use more sophisticated analysis of theutterance to help.I e.g., a [t] might sound like a [d], and so word

information might be needed (more on this later)

48 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

Kinds of ASR systems

Different kinds of systems, with an accuracy-robustnesstradeoff:

I Speaker dependent = work for a single speakerI Speaker independent = work for any speaker of a given

variety of a language, e.g. American English

Thus, a common type of system starts general, but learns:I Speaker adaptive = start as independent but begin to

adapt to a single speaker to improve accuracyI Adaptation may simply be identifying what type of

speaker a person is and then using a model for thattype of speaker

49 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

Kinds of ASR systems

I Differing sizes and types of vocabulariesI from tens of words to tens of thousands of wordsI might be very domain-specific, e.g., flight vocabulary

I continuous speech vs. isolated-word systems:I continuous speech systems = words connected

together and not separated by pausesI isolated-word systems = single words recognized at a

time, requiring pauses to be inserted between words→ easier to find the endpoints of words

50 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

Text-to-Speech Synthesis (TTS)

Could just record a voice saying phrases or words and thenplay back those words in the appropriate order.

I This won’t work for, e.g., dialogue systems wherespeech is generated on the fly.

Or can break the text down into smaller units

1. Convert input text into phonetic alphabet (unambiguous)2. Synthesize phonetic characters into speech

To synthesize characters into speech, people have tried:

I using formulas which adjust the values of thefrequencies, the loudness, etc.

I using a model of the vocal tract and trying to producesounds based on how a human would speak

51 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

Synthesizing Speech

In some sense, TTS really is the reverse process of ASRI Since we know what frequencies correspond to which

vowels, we can play those frequencies to make it soundlike the right vowel.

I However, as mentioned before, sounds are alwaysdifferent (across time, across speakers)

One way to generate speech is to have a database ofspeech and to use the diphones, i.e., two-sound segments,to generate sounds.I Diphones help with the context-dependence of sounds

52 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

Speech to Text to Speech

If we convert speech to text and then back to speech, itshould sound the same, right?

I But at the conversion stages, there is information loss.To avoid this loss would require a lot of memory andknowledge about what exact information to store.

I The process is thus irreversible.

53 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

Demos

Text-to-Speech

I AT&T mulitilingual TTS system:http://www2.research.att.com/∼ttsweb/tts/demo.php

I various systems and languages:http://www.ims.uni-stuttgart.de/∼moehler/synthspeech/

54 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

N-grams: Motivation

Let’s say we’re having trouble telling what word a personsaid in an ASR systemI We could look it up in a phonetic dictionaryI But if we hear something like ni, how can we tell if it’s

knee, neat, need, or some other word?I All of these are plausible wordsI So, we can assign a probability, or weight, to each

change:I e.g., deleting a [t] at the end of a word is slightly more

common than deleting a [d]I We can look at how far off a word is from the

pronunciation; we’ll return to the issue of minimum editdistance with spell checking

I But if the previous word was I, the right choice becomesclearer ...

Material originally based upon chapter 5 of Jurafsky and Martin (2000)

55 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

N-gram definition

An n-gram is a stretch of text n words long

I Approximation of language: information in n-grams tellsus something about language, but doesn’t capture thestructure

I Efficient: finding and using every, e.g., two-wordcollocation in a text is quick and easy to do

N-grams help a variety of NLP applications, including wordprediction

I N-grams can be used to aid in predicting the next wordof an utterance, based on the previous n − 1 words

56 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

Simple n-grams

Let’s assume we want to predict the next word, based on theprevious context of I dreamed I saw the knights in

I What we want to find is the likelihood of w8 being thenext word, given that we’ve seen w1, ...,w7

I So, we’ll have to examine P(w1, ...,w8)

In general, for wn, we are looking for:

(3) P(w1, ...,wn) = P(w1)P(w2|w1)...P(wn |w1, ...,wn−1)

But these probabilities are impractical to calculate: theyhardly ever occur in a corpus, if at all.I And it would be a lot of data to store, if we could

calculate them.

57 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

Unigrams

So, we can approximate these probabilities to a particularn-gram, for a given n. What should n be?I Unigrams (n = 1):

(4) P(wn |w1, ...,wn−1) ≈ P(wn)

I Easy to calculate, but we have no contextual information

(5) The quick brown fox jumped

(6) P(jumped|The, quick , brown, fox) ≈ P(jumped)

I We would like to say that over has a higher probabilityin this context than lazy does.

58 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

Bigrams

bigrams (n = 2) are a better choice and still easy tocalculate:

(7) P(wn |w1, ...,wn−1) ≈ P(wn |wn−1)

(8) P(over |The, quick , brown, fox, jumped) ≈P(over |jumped)

And thus, we obtain for the probability of a sentence:

(9) P(w1, ...,wn) = P(w1)P(w2|w1)P(w3|w2)...P(wn |wn−1)

59 / 60

Language andComputers

Prologue: EncodingLanguage

Writing systemsAlphabetic

Syllabic

Logographic

Systems with unusualrealization

Relation to language

Encoding writtenlanguageASCII

Unicode

Spoken languageTranscription

Why speech is hard torepresent

Articulation

Measuring sound

Acoustics

Relating written andspoken languageFrom Speech to Text

From Text to Speech

Language modeling

Bigram example

What is the probability of seeing the sentence The quickbrown fox jumped over the lazy dog?

(10) P(The quick brown fox jumped over the lazy dog) =P(The|START)P(quick |The)P(brown|quick)...P(dog|lazy)

Or, for our ASR example, we can compare:

(11) P(need|I) > P(neat |I)

60 / 60


Recommended