TWiki
>
Forum Web
>
GrmThraxForum
(revision 12) (raw view)
Edit
Attach
---+ [[GRM.Thrax][OpenGrm Thrax]] Forum You need to be a registered user to participate in the discussions. <br /> %IF{"context authenticated" then='%MAKETEXT{"You are logged in as [_1]." args="[[%WIKIUSERNAME%][%SPACEOUT{%WIKINAME%}%]]"}%%BR%%LOGOUT%' else='%LOGIN% %MAKETEXT{"or"}% [[%TWIKIWEB%.TWikiRegistration][%MAKETEXT{"Register"}%]]'}% %TOC{depth="2"}% You can start a new discussion here: <blockquote> %ICON{help}% You can use the formatting commands describes in TWiki.TextFormattingRules in your comment. <br /> %ICON{tip}% If you want to post some code, surround it with =<verbatim>= and =</verbatim>= tags. <br /> %ICON{warning}% Auto-linking of TWiki.WikiWords is now disabled in comments, so you can type !VectorFst and it won't result in a broken link.<br /> %ICON{warning}% You now need to use =<br>= to force new lines in your comment (unless inside =verbatim= tags). However, a blank line will automatically create a new paragraph. </blockquote> %COMMENT{type="newtopic"}% ---++ compilation fails ---+++ Main.KyleGorman - 05 Nov 2013 - 14:53 <noautolink> Hi Richard (etc.), using Thrax 1.1.0 (and with OpenFst 1.3.4 already installed), compilation fails while making the file `ast/identifier-node.cc` due to an issue in the `include/thrax/compat/utils.h` header. Here's the error: /bin/sh ../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I./../include -g -O2 -MT identifier-node.lo -MD -MP -MF .deps/identifier-node.Tpo -c -o identifier-node.lo `test -f 'ast/identifier-node.cc' || echo './'`ast/identifier-node.cc libtool: compile: g++ -DHAVE_CONFIG_H -I./../include -g -O2 -MT identifier-node.lo -MD -MP -MF .deps/identifier-node.Tpo -c ast/identifier-node.cc -fno-common -DPIC -o .libs/identifier-node.o In file included from ast/identifier-node.cc:22: ./../include/thrax/compat/utils.h:119:8: error: field has incomplete type 'char []' char buf[]; ^ I presume this is because buf[] doesn't have a length defined (nor is it initialized with a string), and when I change the line to char buf[1024]; compilation goes through. (I'm not sure this is a sensible default; I spent no time trying to understand what this code is doing.) I'd include a patch but it's one line. Kyle </noautolink> ---+++ Main.RichardSproat - 05 Nov 2013 - 16:38 <noautolink> Just remove that line: that variable is not used. Apparently it's a holdover from some earlier implementation, and I just forgot to update it. I'll fix this in the next release. </noautolink> %COMMENT{type="mythreadmode"}% ---++ TEST ---+++ Main.RichardSproat - 13 Sep 2013 - 12:16 <noautolink> This is a test. Please ignore. </noautolink> %COMMENT{type="mythreadmode"}% ---++ Recommended way to obtain FST+symbols for use ---+++ Main.JosefNovak - 10 Jun 2013 - 09:46 <noautolink> Hi, I am currently using thrax to extend my some features of an alignment tool I wrote for my g2p system. The basic idea is that the user can specify some alignment correspondence rules and optional default penalties, and then these can be incorporated into the EM training process. At present I have kind of hacked the functionality of the thraxcompiler command tool to read in the grammar, and then return the desired FST+symbol table to the alignment program. EDIT: Maybe it makes more sense to just provide a couple of snippets: *GetFstFromGrammar* <verbatim> template <typename Arc> VectorFst<Arc> GetFstFromGrammar(const string& input_grammar, const string& rules_name) { GrmCompilerSpec<Arc> grammar; VectorFst<StdArc> rules; if ( grammar.ParseFile(input_grammar) && grammar.EvaluateAst() ) { const GrmManagerSpec<Arc>* manager = grammar.GetGrmManager(); FstMap fsts = manager->GetFstMap(); for( typename FstMap::const_iterator it=fsts.begin(); it != fsts.end(); ++it ){ cout << "Echo: " << it->first << endl; } rules = *fsts[rules_name]; return rules; } return rules; } </verbatim> *toy.grm* <verbatim> sy = SymbolTable['simple.syms']; zero = "0".sy : "zero".sy; units = ( "these're".sy : ( "these're".sy | "[these]" | "[these]" "are".sy ) ); split = ( "[these]" "are".sy : "these're".sy ); sigma = "<sigma>".sy : "<sigma>".sy; abc = ( "a".sy "b c".sy : "a b b".sy ); export RULES = Optimize[ sigma* ( units | zero | abc ) sigma* ]; </verbatim> Here the 'sigma' is used in combination with a specialized 1-state alignment transducer that relies on RHO and SIGMA matchers. Is there an alternative or recommended way to do this? It would be great if I could either specify the symbol table just once at the beginning, or automatically infer/generate the whole symbol table and return it - or even better modify the grammar from my C++ application to simply what the user is responsible for doing. I went through the FAQ but did not notice any answers to these questions. Thanks for your time. UPDATE: I solved this by creating some bindings with [[https://code.google.com/p/pybindgen/][pybindgen]] and then writing a generator that interprets a simplified version of the Thrax grammar, then expands it to the versbose version with the extra quotes and symfile suffixes, etc. </noautolink> %COMMENT{type="mythreadmode"}% ---++ Need some help, New to "Thrax" ---+++ Main.GoudjilKamel - 03 Jan 2013 - 17:29 <noautolink> compiling under unbuntu LTS 12.04 : got the msg below at linking libtool: link: g++ -g -O2 -o .libs/thraxcompiler compiler.o -L/usr/local/lib/fst -lm -ldl -lfst /usr/local/lib/fst/libfstfar.so ../lib/.libs/libthrax.so -Wl,-rpath -Wl,/usr/local/lib/fst -Wl,-rpath -Wl,/usr/local/lib ../lib/.libs/libthrax.so: undefined reference to `fst::IsSTList(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' ../lib/.libs/libthrax.so: undefined reference to `fst::IsSTTable(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' collect2: ld returned 1 exit status </noautolink> ---+++ Main.RichardSproat - 29 Aug 2013 - 11:47 <noautolink> Did you compile the fst library with the far extension? </noautolink> %COMMENT{type="mythreadmode"}% ---++ Weight semiring ---+++ Main.LauriLyly - 21 Nov 2012 - 00:34 <noautolink> So far I find thrax a very neat piece of software but I have two questions... Can I somehow use probability semiring as weights, because it seems Thrax only allows specifying log and tropical semirings? How about the other ones... Or should I somehow postprocess the generated far file? Another question: I tried to use "fstdraw" on a far file, but got: ERROR: FstHeader::Read: Bad FST header: example.far Is this a version mismatch? </noautolink> ---+++ Main.LauriLyly - 29 Nov 2012 - 07:34 <noautolink> Sorry, obviously my bad as it's a far and not an fst file :p Still not too familiar. But the weight question still applies ;) </noautolink> ---+++ Main.RichardSproat - 29 Nov 2012 - 10:07 <noautolink> Sorry, I missed the earlier comment -- for some reason I didn't get email about it. Unfortunately the restriction to Log and Tropical is due to a similar restriction in the fst library: the real semiring does not come predefined. The best suggestion would be to use Tropical and then just do the obvious e^-cost conversion. </noautolink> %COMMENT{type="mythreadmode"}% -- Main.CyrilAllauzen - 13 Aug 2012
Edit
|
Attach
|
Watch
|
P
rint version
|
H
istory
:
r162
|
r14
<
r13
<
r12
<
r11
|
B
acklinks
|
V
iew topic
|
Raw edit
|
More topic actions...
Topic revision: r12 - 2013-11-05
-
RichardSproat
Forum
Log In
or
Register
Forum Web
Create New Topic
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
Webs
Contrib
FST
Forum
GRM
Kernel
Main
Sandbox
TWiki
Main
Copyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback