Practical Skills in Corpus Linguistics Seminar

slide1 n.w
1 / 45
Embed
Share

Explore the world of corpus linguistics through this seminar focusing on essential skills such as searching for words in corpora, frequency distributions, collocational strength, and more. Gain insights into text processing, metadata details, and underlying representations with practical examples and applications.

  • Corpus Linguistics
  • Seminar
  • Language Analysis
  • Data Processing
  • Linguistic Studies

Uploaded on | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. + Using Corpora - I Albert Gatt 31stOctober, 2014

  2. +Goals of this seminar Practical skills: Searching for words in corpora and quantifying results Basics of frequency distributions Measures of collocational strength Keyword analysis 1. Pattern-matching Regular expressions Corpus query language 2. Analysing results Sampling from resultsets Categorising outcomes 3.

  3. + Some basic concepts Part 1

  4. +Text

  5. +Text (vertical format) Paragraph splitting, sentence splitting, tokenisation p s Didelphoidea Didelphoidea hija superfamilja ta' mammiferi marsupjali , e attament l- opossumi tal- kontinenti Amerikani s text p ... ... ... s

  6. +Metadata Text-level Information about the text, origins etc. E.g. Text genre Can be very detailed, e.g. include gender of author Depends on the info available.

  7. +Metadata Structural Information about the principal divisions. Section, heading, paragraph...

  8. +Metadata Token-level Information about individual words: Part of speech Lemma Orthographic info (e.g. Error coding) Sentiment Word sense (pretty much anything that might be relevant, and is feasible)

  9. +Underlying representation: MLRS

  10. +Underlying representation: CLEM

  11. +Underlying representation: BNC Utterance tag + speaker ID attribute <u who=D00011> <s n=00011> <event desc="radio on"> Sentence tag within utterance Non-verbal action during speech <w PNP><pause dur=34>You <w VVD>got <w TO0>ta <unclear> <w NN1>Radio <w CRD>Two <w PRP>with <w DT0>that <c PUN>. Pauses marked with duration Unclear, non- transcribed speech </u> Many other tags to mark non-linguistic phenomena...

  12. +Levels of linguistic annotation part-of-speech (word-level) lemmatisation (word-level) parsing (phrase & sentence-level -- treebanks) semantics (multi-level) semantic relations between words and phrases semantic features of words discourse features (supra-sentence level) phonetic transcription prosody

  13. +Searching It is important to know what metadata is available in a corpus. Corpus Text-level Structural Token-level MLRS v1.0 Text type Paragraph, sentence, token None MLRS v2.0 Text type Paragraph, sentence, token Part of speech MLRS v3.0 (forthcoming) Text type Paragraph, sentence, token Part of speech Lemma, root, (phonetic trans) CLEM v1.0 Exam level Paragraph, sentence, token Part of speech, lemma CLEM v2.0 (forthcoming) Exam level, gender, mark/grade, locality, school Paragraph, sentence, token Part of speech, lemma, orthographic errors

  14. +How its used May be online or local

  15. +Tools We will be using online interfaces to corpora: MLRS (Maltese Language Resource Server) Uses the Corpus Workbench and CQP Different corpora available in English and Maltese Other online interfaces: SketchEngine (http://www.sketchengine.co.uk) Corpora in several languages Similar interface Requires licence Corpora @ BYU (http://corpus.byu.edu ) Different corpora (mostly English) Somewhat different search interface Free You also have access to a large corpus called the Web

  16. + Part 3 Part-of-speech tagging

  17. +Part of speech tagging Purpose: Label every token with information about its part of speech. Requirements: A tagset which lists all the relevant labels.

  18. +Part of speech tagsets Tagging schemes can be very granular. Maltese example: VV1SR: verb, main, 1st pers, sing, perf imxejt I walked VA1SP: verb, aux, 1st pers, sing, past kont miexi I was walking NNSM-PS1S: noun, common, sing, masc + poss. pronoun, sing, 1st pers missier-i my father

  19. +How POS Taggers work Start with a manually annotated portion of text (usually several thousand words). the/DET man/NN1 walked/VV 1. Extract a lexicon and some probabilities. Probability that a word is NN given that the previous word is DET. 2. Run the tagger on new data. 3.

  20. +Challenges in POS tagging Recall that the process is usually semi-automatic. Granularity vs. correctness the finer the distinctions, the greater the likelihood of error manual correction is extremely time-consuming

  21. +Try it out Maltese (MLRS POS Tagger): http://metanet4u.research.um.edu.mt/tools.jsp English (example from LingPipe): http://alias-i.com/lingpipe/web/demo-pos.html

  22. + Words I: BNC and SkE Part 3

  23. +Get online! We ll work with the British National Corpus first. SketchEngine: http://www.sketchengine.co.uk Username: lin3098 Password: pZxMmUaVTd

  24. +Use case 1: word frequencies Construct a word list for the entire BNC Rank-frequency distribution Zipf s law

  25. +Use case 2: KWIC Concordance Case study: quiver: transitive or intransitive? Basic search Use the simple search interface to find word in context. View frequency by text type Analyse results. Take a random sample (n = 100) View concordance

  26. +KIWC/sentence views

  27. +KIWC/sentence views

  28. +Frequency representation Simple frequency: Just the raw frequency of the word/phrase Multilevel frequency distribution: Cross-classification Eg. frequency of word/phrase by document type

  29. +Relative frequency Corpus 1000 words Quiver: 100 times Expectation: Since A is 50% and B is 50% of total, then quiver would be expected to occur 50% of the time in A and 50% of the time in B. Subcorpus A 500 words Subcorpus B 500 words Quiver: 50 times Quiver: 50 times The distribution of quiver over the 2 subcorpora matches the distribution of the two subcorpora within the whole (50%) Relative frequency in A = 100% Relative frequency in B = 100%

  30. +Frequency by doc type Thickness = raw frequency Length = text type frequency

  31. +Relative frequency Corpus 1000 words Quiver: 100 times Expectation: Since A is 50% and B is 50% of total, then quiver would be expected to occur 50% of the time in A and 50% of the time in B. Subcorpus A 500 words Subcorpus B 500 words Quiver: 75 times Quiver: 25 times The distribution of quiver over the 2 subcorpora does not match the distribution of the two subcorpora within the whole (50%) Relative frequency in A > 100% Relative frequency in B < 100%

  32. +A better concordance Slightly more informed Search by lemma Exploit POS information: quiver only as a verb Look at frequencies of node + word to the right

  33. +Use case 3: big, large, great A traditional dictionary (OED online): large adj.of considerable or relatively great size, extent, or capacity big adj. of considerable size, physical power, or extent great adj. of an extent, amount, or intensity considerably above average Can collocational analysis give a better sense of the differences?

  34. +A motivating example Consider phrases such as: strong tea strong support powerful drug ? powerful tea ? powerful support ? strong drug Traditional semantic theories have difficulty accounting for these patterns. strong and powerful seem to be near-synonyms do we claim they have different senses? what is the crucial difference?

  35. +The empiricist view of meaning Firth s view (1957): You shall know a word by the company it keeps This is a contextual view of meaning, akin to that espoused by Wittgenstein (1953). In the Firthian tradition, attention is paid to patterns that crop up with regularity in language. Contrast symbolic/rationalist approaches, emphasising polysemy, componential analysis, etc. Statistical work on collocations tends to follow this tradition.

  36. +Defining collocations Collocations are statements of the habitual or customary places of [a] word. (Firth 1957) Characteristics/Expectations: regular/frequently attested; occur within a narrow window (span of few words); not fully compositional; non-substitutable; non-modifiable display category restrictions

  37. +Collocation analysis The term collocation typically refers to some semantically interesting relationship between two (or more) words. But the techniques we will look at are in fact generalisable. Can be used to quantify the closeness between any two words.

  38. +Get some data! Run a concordance for big/large/great. You can control how wide your window is. Use the context option from the left menu. We can restrict our search to the immediate right collocate which is a noun.

  39. +Get some data! Make a note of: The frequency of each adjective For each adjective, generate the list of collocates by choosing the collocations option from the left menu. Sort the collocates by frequency. Take note of: The top 10 most frequent NOUN collocates.

  40. +Measures of collocational strength Statistical measures of collocational strength are based on the following notion: If x and y are truly collocated then the likelihood of x and y cropping up together should be greater than the likelihood of x and y cropping up independently. Case 1: x and y are independent Case 2: x and y are collocated If this is true, the P(y|x) should be no larger than P(y)P(x) If this is true, the P(y|x) should be (significantly) larger than P(y)P(x)

  41. +Common measures: Mutual Info ( x , P ) y P x y log ( ) ( ) P A ratio that seeks to answer the question: How much do I get to know about y If I also know about x (i.e. How much information about y is contained in x) The relevant sense of information here: Occurrence: does an occurrence of x also guarantee that y will occur?

  42. +Common measures: T-test A ratio that seeks to answer the question: If I make the assumption that x and y are related, does this differ statistically from the assumption that x and y are not related? Example: is large number a collocation? My corpus (ukWaC) contains 239,074,304 two-word sequences. I can answer the question above by counting how many of these sequences are the one I am interested in.

  43. +Common measures: T-test cont/d Large and number are independent Large and number are not independent (i.e. They are collocated) <large x> <x number(s)> Large number Any bigram C(w) 555,510 1,303,561 C(w1,w2) 50,833 239,074,304 P(w) 0.0023 0.0054 P(large number) 0.00021 P(large)P(number ) 0.0000126 0000126 . 0 00021 . 0 = = 210 62 . t 00021 . 0 239074304

  44. +Common measures: chi-square A ratio that seeks to answer the question: If I make the assumption that x and y are related, does this differ statistically from the assumption that x and y are not related? I.e. Just like the t-test Main difference: The t-test works with probabilities Chi-square is designed to work directly with frequencies.

  45. +Common measures: log likelihood A ratio that seeks to answer the question: What evidence do I have for the hypothesis that x and y are related, compared to the hypothesis that they are not? (I won t go into the maths) Log likelihood is used more often than chi-square (and can be interpreted in much the same way).

Related


More Related Content