Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #95472 > unrolled thread

Xfst Download

Started byCornelia Mesker <meskercornelia@gmail.com>
First post2024-01-17 14:43 -0800
Last post2024-01-17 14:43 -0800
Articles 1 — 1 participant

Back to article view | Back to comp.lang.javascript


Contents

  Xfst Download Cornelia Mesker <meskercornelia@gmail.com> - 2024-01-17 14:43 -0800

#95472 — Xfst Download

FromCornelia Mesker <meskercornelia@gmail.com>
Date2024-01-17 14:43 -0800
SubjectXfst Download
Message-ID<b5b44282-e61a-4ea2-a22c-9d7a5f5aeb92n@googlegroups.com>
<div>We demonstrate the construction ofa typical finite-state morphological analyzerthrough modeling English noun pluralization.We use xfst and lexc, two well-known FST specification languages,for this exercise.These languages were originally developed by Xerox,and used for constructing morphological analyzers fora large number of languages.For the demo below,you can use one of the free/open source implementations.</div><div></div><div></div><div></div><div>xfst download</div><div></div><div>DOWNLOAD &#187;&#187;&#187; https://t.co/CXorEovCRM</div><div></div><div></div><div></div><div></div><div></div><div></div><div>Xfst is a formalism for specifying finite-state transducersusing regular expressions(you may find its regular expression syntax syntax somewhat odd, though).Specifying long list of words may get rather clumsy in in xfst.In practice, it is used with lexc, another formalism designed forspecifying lexicons in a more convenient way.</div><div></div><div></div><div>We will not go thorough a description of xfst and lexc formalisms here.The descriptions are limited to the examples demonstrated.The authoritative reference for Xerox tools and formalisms isBeesley and Karttunen (2003)(tip: you may find a pre-print copy electronic with a web search).HFST and Fomaweb pages include some reference documentation and also linksto (other) tutorials.</div><div></div><div></div><div>If we write the above to a text file with name noun.lexc,we can read the whole lexicon with command read lexc noun.lexcin the xfst interface.Lexc allows a more than simply listing the files,but we will not cover them this short demonstration.</div><div></div><div></div><div>The above shows how to generate a word from its underlyingrepresentation. However, we most often use a finite-state morphologytool as an analyzer. Xerox xfst defines a command apply up that willproduce the analysis symbol of a given word. The xfst implementationof HFST does not implement apply up. So, to be able to analyzesurface words, we will invert our generator.</div><div></div><div></div><div>The .i operator in xfst inverts a given regular expression.Alternatively we could also use the command invert net withoutnaming (saving) the generator. Note that resulting analyzer gives thecorrect analyses of the valid words, while rejecting the wronglyinflected versions.</div><div></div><div></div><div>This assignment involves a little bit of coding with xfst. You'll need to turn in some code and results files, which should be submitted via Canvas.Problem 1. Morphology and FSTs(Adapted form of:) Problem 3.3 (p.81)Using xfst, write a finite-state transducer that can generate and analyze a small set of verbs in all of their inflected forms. This FST will handle two spelling change rules: the rule that deletes a final e before -ingor -ed, and the rule that inserts a k when c appears between a vowel and -ing or -ed. The first rule is provided already. Your job is to write the second.Note: xfst defines a language for regular expressions which makes it relatively easy to write morphophonological rewrite rules. For this problem, however, you must stay with the basic operators. No credit will be given for answers that use the xfst operator -> or its kin. On the other hand, if you get stuck, you might find it helpful to write the rule in that notation, and then examine the network that xfstproduces.To do this assignment, you'll need the following two files:k.xfstverb_lexiconCopy them somewhere onto your Patas home directory. Log in to patas and do:'wget path_to_file'. If you're using Windows to download them, make sure that it doesn't add any new file extensions.verb_lexicon is the lexicon of verbs (in citation form) that we'll be working with.</div><div></div><div>k.xfst is the xfstscript that does the work. It is the file you'll need to modify for this part of the assignment.To start xfst, log onto Patas and type "xfst" (your $path variable should already be set appropriately). You'll get an xfst prompt.To run the script, enter:source k.xfstAfter you've run the script, there should be an FST on the stack. To apply that FST, try:apply up sprucedapply down picnic+ingObserve that it doesn't yet have the right behavior in the second example.Modify k.xfst until it has the right behavior. The files produced by the script (underlying, onerule, tworules and threerules) should be helpful in testing it as you go. You can also use apply up and apply downto observe the behavior of the network. Here is a short summary of xfst syntax. </div><div></div><div></div><div></div><div>Hint: If you have trouble, try commenting out the first rule and then writing a most simple rule as a first rule, to make sure you can at least observe some change happening. Make sure you understand the function of the ':' and the concepts fof upper and lower tape.To examine a network, type:print netThe network defined in k.xfst is too large to be usefully examined like this, but you might try some others:read regex [a b c];print netread regex [a+ b c];print netread regex [e %+ -> 0  _ [ei] ];print netTurn ink.xfst</div><div></div><div>this fileas modified by you.threerules</div><div></div><div>This file is output when the script k.xfst is run. xfst_writeup.pdf</div><div></div><div> Write up: In 3-4 paragraphs, in a pdf file, answer the following questions:  Would it be easier to write a complete morphophonological analyzer for English represented orthographically (i.e. in standard spelling, where the lower tape has standard orthographical forms) or phonetically (where the lower tape has pronunciations in IPA)? For each case, what representation would you choose for the upper tape, and why? What are some applications that would require each kind of morphophonological analyzer for English, and what would happen if you fed them the wrong type? Problem 2. Stress Movement in SpanishText-to-speech systems rely on large pronunciation dictionaries in combination with rules for unknown words, or for large morphologies. Since English doesn't have a very complex morphology, we will use stress patterns in Spanish to demonstrate the need for pronunciation rules. Spanish has a fairly simple pattern of stress assignment. It is, roughly:</div><div></div><div></div><div></div><div></div><div></div><div></div><div>Or, using the 'explode' operators, like this:[ cat  dog ]Recall that % is the escape character, and that most punctuation marks have a special meaning in xfst and therefore need to be escaped. A short summary ofxfst syntax can be found here.</div><div></div><div></div><div>This assignment involves a little bit of coding with xfst. You'll need to turn in some code and results files, which should be submitted via Canvas.Problem 1. Morphology and FSTs(Adapted form of:) Problem 3.3 (p.81)Using xfst, write a finite-state transducer that can generate and analyze a small set of verbs in all of their inflected forms. This FST will handle two spelling change rules: the rule that deletes a final e before -ingor -ed, and the rule that inserts a k when c appears between a vowel and -ing or -ed. The first rule is provided already. Your job is to write the second.Note: xfst defines a language for regular expressions which makes it relatively easy to write morphophonological rewrite rules. For this problem, however, you must stay with the basic operators. No credit will be given for answers that use the xfst operator -> or its kin. On the other hand, if you get stuck, you might find it helpful to write the rule in that notation, and then examine the network that xfstproduces.To do this assignment, you'll need the following two files:k.xfstverb_lexiconCopy them somewhere onto your Patas home directory. Log in to patas and do:'wget path_to_file'. If you're using Windows to download them, make sure that it doesn't add any new file extensions.verb_lexicon is the lexicon of verbs (in citation form) that we'll be working with.</div><div></div><div>k.xfst is the xfstscript that does the work. It is the file you'll need to modify for this part of the assignment.To start xfst, log onto Patas and type "xfst" (your $path variable should already be set appropriately). You'll get an xfst prompt.To run the script, enter:source k.xfstAfter you've run the script, there should be an FST on the stack. To apply that FST, try:apply up sprucedapply down picnic+ingObserve that it doesn't yet have the right behavior in the second example.Modify k.xfst until it has the right behavior. The files produced by the script (underlying, onerule, tworules and threerules) should be helpful in testing it as you go. You can also use apply up and apply downto observe the behavior of the network. Here is a short summary of xfst syntax. </div><div></div><div></div><div></div><div>Hint: If you have trouble, try commenting out the first rule and then writing a most simple rule as a first rule, to make sure you can at least observe some change happening. Make sure you understand the function of the ':' and the concepts fof upper and lower tape.To examine a network, type:print netThe network defined in k.xfst is too large to be usefully examined like this, but you might try some others:read regex [a b c];print netread regex [a+ b c];print netread regex [e %+ -> 0  _ [ei] ];print netTurn ink.xfst</div><div></div><div>this fileas modified by you.threerules</div><div></div><div>This file is output when the script k.xfst is run. Write up: In 3-4 paragraphs, answer the following questions:  Would it be easier to write a complete morphophonological analyzer for English represented orthographically (i.e. in standard spelling, where the lower tape has standard orthographical forms) or phonetically (where the lower tape has pronunciations in IPA)? For each case, what representation would you choose for the upper tape, and why? What are some applications that would require each kind of morphophonological analyzer for English, and what would happen if you fed them the wrong type? Problem 2. Text-to-SpeechText-to-speech systems rely on large pronunciation dictionaries in combination with rules for dealing with unknown words. One large class of typically unknown words is names, including people's names. This assignment will focus on one particular aspect of predicting the pronunciation of names, namely stress assignment. In particular, there are 'name suffixes' (recurring forms at the end of many different names) which leave the stress assignment of the stem unchanged (stress-neutral name suffixes) and those which cause the stress to move (stress-changing suffixes). Stress assignment is important for figuring out pronunciation because a) phonological rules affecting the pronunciation of segments are sensitive to stress and b) lexical stress interacts with other factors to determine the prosody of an utterance.Your tasksFind 6 name stems (surname stems; perhaps by consulting a phone book), with the following properties:A one-syllable name stemA two-syllable name stem with stress on the first syllableA two-syllable name stem with stress on the second syllableA three-syllable name stem with stress on the first syllableA three-syllable name stem with stress on the second syllableA three-syllable name stem with stress on the third syllable Stress notation: Indicate stress by placing a ' (single quote) before the vowel of the stressed syllable.Find two name suffixes, one which is stress neutral and one which changes the stress on the stem. The stress-changing suffix should leave the stress somewhere on the stem, NOT on the suffix itself.If you're not a native English speaker, and you don't have intuitions about these stress patterns, find a native speaker and ask them.Determine how the stress changes: write out all 12 names you can make by attaching one or the other suffix to your 6 names, and indicate in this list where the (primary) stress is in each one, using the stress notation given above. This list is what you will use to evaluate whether or not your system is working.Write a regular expression in xfst which represents the possible underlying forms (stem only; stem + suffix, with the morpheme boundary and underlying stress indicated). You may find it useful to use the 'explode' operators  . In xfst regular expressions, characters not separated by spaces are treated as multicharacter symbols. This is not what you want. Therefore, (part of) your regular expression will either have to look like this:[ c a t  d o g ]Or, using the 'explode' operators, like this:[ cat  dog ]Recall that % is the escape character, and that most punctuation marks have a special meaning in xfst and therefore need to be escaped. A short summary ofxfst syntax can be found here.</div><div></div><div> dca57bae1f</div>

[toc] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web