27
89-680 1 - תתתתת תתתת תתתתתת תתתתת תתתתת תתתתת תתתתתתתתת תתתת תתתתתת תתתתתת תתתתת תתתתת תתתתתתתתתת תת תתתת

עיבוד שפות טבעיות - שיעור שלישי ניתוח מורפולוגי

  • Upload
    miller

  • View
    48

  • Download
    5

Embed Size (px)

DESCRIPTION

עיבוד שפות טבעיות - שיעור שלישי ניתוח מורפולוגי. אורן גליקמן המחלקה למדעי המחשב אוניברסיטת בר אילן. בנית מנתח מורפולוגי. המטרות: Recognizer : האם מילה היא תקנית או לא Generator : מייצר מילים מניתוח מורפולוגי מסוים Parser : נותן ניתוח מורפולוגי למלים Stemmer :נותן בסיס ( stem ) של מילה - PowerPoint PPT Presentation

Citation preview

Page 1: עיבוד שפות טבעיות - שיעור שלישי ניתוח מורפולוגי

89-6801

עיבוד שפות טבעיות - שיעור שלישיניתוח מורפולוגי

אורן גליקמןהמחלקה למדעי המחשב

אוניברסיטת בר אילן

Page 2: עיבוד שפות טבעיות - שיעור שלישי ניתוח מורפולוגי

89-6802

בנית מנתח מורפולוגי

המטרות:•–Recognizerהאם מילה היא תקנית או לא :–Generatorמייצר מילים מניתוח מורפולוגי מסוים :–Parserנותן ניתוח מורפולוגי למלים :–Stemmer( נותן בסיס:stemשל מילה )

לא יעיל ולפעמים גם אי אפשר לשים בלקסיקון •את כל המילים על צורת ההטיה שלהן.

Page 3: עיבוד שפות טבעיות - שיעור שלישי ניתוח מורפולוגי

89-6803

בניית מנתח מורפולוגי...

כדי לבנות מנתח מורפולוגי יש צורך ב:•, עם מידע affixes ו-stems - רשימת שורשים לקסיקון–

הוא שם עצם, פועל וכו'.stemכללי כגון האם ה-–Morphotactics המודל לסידור המורפמות )איזו -

מורפמה היא תחילית ואיזו סופית( חוקי הכתיב orthographic rulesחוקים אורתוגרפיים –

- שינויים החלים במילה למשל - y-> ie כמו במקרה של city + -s -> cities

Page 4: עיבוד שפות טבעיות - שיעור שלישי ניתוח מורפולוגי

89-6804

Finite-State Automaton for English Nominal

Inflection 

– Regular: fox, dog, city: add s– Irregular: goose, mouse, sheep (memorize)

Page 5: עיבוד שפות טבעיות - שיעור שלישי ניתוח מורפולוגי

89-6805

הטמעת המילון באוטומט

Page 6: עיבוד שפות טבעיות - שיעור שלישי ניתוח מורפולוגי

89-6806

Finite State Transducer

• To go beyond mere recognition, we need a transducer

• A transducer maps between one set of symbols and another; a finite state transducer does this via a finite automaton.

• An FST can be seen as a recognizer, generator or translator.

Page 7: עיבוד שפות טבעיות - שיעור שלישי ניתוח מורפולוגי

89-6807

Two-Level Morphology 

• Two-level morphology represents a word as a correspondence between a lexical level, which represents a simple concatenation of morphemes making up a word, and the surface level, which represents the actual spelling of the final word.

Page 8: עיבוד שפות טבעיות - שיעור שלישי ניתוח מורפולוגי

89-6808

FSTs

Page 9: עיבוד שפות טבעיות - שיעור שלישי ניתוח מורפולוגי

89-6809

English Nominal Inflection FST

Page 10: עיבוד שפות טבעיות - שיעור שלישי ניתוח מורפולוגי

89-68010

FSTהוספת חוקי איות ל-

ישנם חוקי איות שהם תלויי הקשר•למשל -•

–cat + N + PL -> cats–fox + N + PL -> foxes

Page 11: עיבוד שפות טבעיות - שיעור שלישי ניתוח מורפולוגי

89-68011

“Three” level morphology

אחת לשנייה, כך FSTניתן לצרף מכונות •שהפלט של האחת היא הקלט של השנייה.

לטיפול בחוקי האיות יוצרים שלוש שכבות:•–Lexical–Intermediate–Surface

Page 12: עיבוד שפות טבעיות - שיעור שלישי ניתוח מורפולוגי

89-68012

Orthographic Rules FSTWe need an FST to add an e between an x, s or z and intermediate before the s at morpheme boundary at the end of a word.

A key point of this transducer is that irrelevant stuff passes that through unchanged.

Page 13: עיבוד שפות טבעיות - שיעור שלישי ניתוח מורפולוגי

89-68013

Composition of FSTs

• Actually running a cascade as a cascade can turn out to be a pain... – it is hard to manage all the tapes – it fails to take advantage of the restricting power of all

the machines• So... • it is better to compile the cascade into a single

large machine with two tapes )input and output(

Page 14: עיבוד שפות טבעיות - שיעור שלישי ניתוח מורפולוגי

89-68014

English Derivation

• Much more complex than inflectional• As an example, consider adjectives

– Big, bigger, biggest– Cool, cooler, coolest, coolly– Red, redder, reddest– Clear, clearer, clearest, clearly, unclear,

unclearly– Happy, happier, happiest, happily– Unhappy, unhappier, unhappiest, unhappily– Real, unreal, silly

Page 15: עיבוד שפות טבעיות - שיעור שלישי ניתוח מורפולוגי

89-68015

English Adjective Derivation

Page 16: עיבוד שפות טבעיות - שיעור שלישי ניתוח מורפולוגי

89-68016

What’s wrong?

• Accepts all adjectives above, but• Also accepts unbig, readly, realest• Common problem: over generation• Solution?• Need classes of roots that say

which can occur with which suffixes

Page 17: עיבוד שפות טבעיות - שיעור שלישי ניתוח מורפולוגי

89-68017

Revised FSA

Page 18: עיבוד שפות טבעיות - שיעור שלישי ניתוח מורפולוגי

89-68018

And it can get much more complex…

Page 19: עיבוד שפות טבעיות - שיעור שלישי ניתוח מורפולוגי

89-68019

Stemming

• Lexicon Free• The stem is not the same as the morphological

root )it is not necessarily a lexical item!(• In IR

– the key is to acquire the stems, not to make any real use of morphological structure, hence the term

– Small performance improvements in practice )if any!!!(– with larger documents, less needed – Introduces errors: e.g. organization organ

Page 20: עיבוד שפות טבעיות - שיעור שלישי ניתוח מורפולוגי

89-68020

Porter Stemmer• Example Rules:• Step 1a

– SSES -> SS (caresses caress)– IES -> I (ponies poni, ties ti)– SS -> SS (caress caress)– S (cats cat)

• Step 1b – (m>0) EED EE (feed feed, agreed agree)– (*v*) ED (plastered plaster, bled

bled) (*v*) ING (motoring motor, sing sing)

Page 21: עיבוד שפות טבעיות - שיעור שלישי ניתוח מורפולוגי

89-68021

Porter Algoritm• Step 2

– (m>0) ATIONAL -> ATE relational -> relate – (m>0) TIONAL -> TION conditional -> condition – (m>0) ENCI -> ENCE valenci -> valence – (m>0) ANCI -> ANCE hesitanci -> hesitance – (m>0) IZER -> IZE digitizer -> digitize – (m>0) ABLI -> ABLE conformabli -> conformable

(m>0) ALLI -> AL radicalli -> radical – (m>0) ENTLI -> ENT differentli -> different

• Etc…

Page 22: עיבוד שפות טבעיות - שיעור שלישי ניתוח מורפולוגי

89-68022

Human Morphological Processing

• How are multi-morphemic words represented in the minds of human speakers?

• full-listing hypothesis vs. minimum redundancy hypothesis

Page 23: עיבוד שפות טבעיות - שיעור שלישי ניתוח מורפולוגי

89-68023

Experiments

• Stanners et al. 1979: a word is recognized faster if it has been seen before (priming)– lifting lift, burned burn– selective / select– i.e. different representations for inflection and

derivation.• Marsen-Wilson et al. 1994: spoken derived

words can prime their stems, but only if their meaning is close:– government govern, – department / depart

Page 24: עיבוד שפות טבעיות - שיעור שלישי ניתוח מורפולוגי

89-68024

Page 25: עיבוד שפות טבעיות - שיעור שלישי ניתוח מורפולוגי

89-68025

Some more on Words

• Type vs. token• Word senses• How many words are there in the

following sentence: “If she is right and I am wrong then we are way over to the right of where we ought to be.”

• Zipfs Law: f 1/r

Page 26: עיבוד שפות טבעיות - שיעור שלישי ניתוח מורפולוגי

89-68026

Summary

מילים3והמשפחה: •סוכריות:מורפולוגיה• סוכריה גזירה: סוכר • סוכריות,אכלנוהטיה: סוכריה •FSTניתן למדל מורפולוגיה ע"י ••Stemming

Page 27: עיבוד שפות טבעיות - שיעור שלישי ניתוח מורפולוגי

89-68027

Homework