Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement n-best output in lt-proc #3

Closed
ftyers opened this issue Apr 17, 2018 · 4 comments
Closed

Implement n-best output in lt-proc #3

ftyers opened this issue Apr 17, 2018 · 4 comments
Labels
enhancement New feature or request

Comments

@ftyers
Copy link
Member

ftyers commented Apr 17, 2018

Implement an option to lt-proc to output n-best paths. We can use the same option names as in hfst-proc:

  -N N, --analyses=N      Output no more than N analyses
                          (if the transducer is weighted, the N best analyses)
  --weight-classes N      Output no more than N best weight classes
                          (where analyses with equal weight constitute a class

They should work for both analysis and generation.

@ftyers ftyers added the enhancement New feature or request label Apr 17, 2018
Techievena added a commit to Techievena/lttoolbox that referenced this issue May 27, 2018
Using the same option names as `hfst-proc` we add options in
lt-proc to output n-best paths using the weight values.

Closes apertium#3
Techievena added a commit to Techievena/lttoolbox that referenced this issue May 27, 2018
Using the same option names as `hfst-proc` we add options in
lt-proc to output n-best paths using the weight values.

Closes apertium#3
Techievena added a commit to Techievena/lttoolbox that referenced this issue May 28, 2018
Using the same option names as `hfst-proc` we add options in
lt-proc to output n-best paths using the weight values.

Closes apertium#3
@Techievena
Copy link
Member

Techievena commented May 30, 2018

@ftyers Please give some directions on how to calculate the weights and start working on this issue.. like the files and classes I should begin modifying first.

@Techievena
Copy link
Member

Techievena commented May 30, 2018

Moreover there is no way we can test this unless we modify the parser to read weights from dix files. Because until the parsers are able to read weights from dix file, it is always the default value of weights we are considering, i.e. 0.0000

@ftyers
Copy link
Member Author

ftyers commented May 30, 2018

@Techievena you could compile an ATT file with weights in using HFST:

$ cat test.lexc 
Multichar_Symbols

%<n%> %<vblex%> 

%<sg%> %<pl%> %<ger%> %<pres%> %<p3%> %<inf%>

LEXICON Root

Verbs ;
Nouns ;

LEXICON N 

%<n%>%<sg%>: # "weight: 1.0" ;
%<n%>%<pl%>:s # "weight: 1.5" ; 

LEXICON V

%<vblex%>%<inf%>: # "weight: 1.0" ;
%<vblex%>%<pres%>: # "weight: 1.0" ;
%<vblex%>%<pres%>%<p3%>%<sg%>:s # "weight: 1.0" ; 


LEXICON Verbs

walk:walk V "weight: 1.0" ; 

LEXICON Nouns 

walk:walk N "weight: 1.5" ; 

You can see the strings:

$ hfst-lexc test.lexc -o - | hfst-fst2strings -w
hfst-lexc: warning: Defaulting to OpenFst tropical type
Root...2 N...2 V...3 Verbs...1 Nouns...
walk<n><sg>:walk	2.5
walk<n><pl>:walks	3
walk<vblex><pres>:walk	2
walk<vblex><inf>:walk	2
walk<vblex><pres><p3><sg>:walks	2

And print them:

$ hfst-lexc test.lexc -o - | hfst-fst2txt > test.att
hfst-lexc: warning: Defaulting to OpenFst tropical type
Root...2 N...2 V...3 Verbs...1 Nouns...
$ cat test.att 
0	1	w	w	2.000000
1	2	a	a	0.000000
2	3	l	l	0.000000
3	4	k	k	0.000000
4	5	<n>	@0@	0.500000
4	6	<n>	s	1.000000
4	7	<vblex>	@0@	0.000000
4	8	<vblex>	s	0.000000
5	9	<sg>	@0@	0.000000
6	9	<pl>	@0@	0.000000
7	9	<pres>	@0@	0.000000
7	9	<inf>	@0@	0.000000
8	10	<pres>	@0@	0.000000
9	0.000000
10	5	<p3>	@0@	0.000000

And compile:

$ lt-comp lr test.att test.bin
main@standard 11 14

@Techievena
Copy link
Member

Thanks a lot for clearing this out for me how to get the att files. This thing must be included in the att_format wiki of Apertium. I have been scratching my head for a long time what you meant by transducer.att files. I will modify the tests of the other PR by tommorow. Thanks a lot!!!

Techievena added a commit to Techievena/lttoolbox that referenced this issue Jun 15, 2018
Using the same option names as `hfst-proc` we add options in
lt-proc to output n-best paths using the weight values.

Closes apertium#3
Techievena added a commit to Techievena/lttoolbox that referenced this issue Jun 16, 2018
Using the same option names as `hfst-proc` we add options in
lt-proc to output n-best paths using the weight values.

Closes apertium#3
Techievena added a commit to Techievena/lttoolbox that referenced this issue Jun 17, 2018
Using the same option names as `hfst-proc` we add options in
lt-proc to output n-best paths using the weight values.

Closes apertium#3
Techievena added a commit to Techievena/lttoolbox that referenced this issue Jun 19, 2018
Using the same option names as `hfst-proc` we add options in
lt-proc to output n-best paths using the weight values.

Closes apertium#3
Techievena added a commit to Techievena/lttoolbox that referenced this issue Jun 20, 2018
Using the same option names as `hfst-proc` we add options in
lt-proc to output n-best paths using the weight values.

Closes apertium#3
Techievena added a commit to Techievena/lttoolbox that referenced this issue Jun 20, 2018
Using the same option names as `hfst-proc` we add options in
lt-proc to output n-best paths using the weight values.

Closes apertium#3
Techievena added a commit to Techievena/lttoolbox that referenced this issue Jun 20, 2018
Using the same option names as `hfst-proc` we add options in
lt-proc to output n-best paths using the weight values.

Closes apertium#3
Techievena added a commit to Techievena/lttoolbox that referenced this issue Jun 20, 2018
Using the same option names as `hfst-proc` we add options in
lt-proc to output n-best paths using the weight values.

Closes apertium#3
Techievena added a commit to Techievena/lttoolbox that referenced this issue Jun 21, 2018
Using the same option names as `hfst-proc` we add options in
lt-proc to output n-best paths using the weight values.

Closes apertium#3
Techievena added a commit to Techievena/lttoolbox that referenced this issue Jun 21, 2018
Using the same option names as `hfst-proc` we add options in
lt-proc to output n-best paths using the weight values.

Closes apertium#3
Techievena added a commit to Techievena/lttoolbox that referenced this issue Jun 23, 2018
Using the same option names as `hfst-proc` we add options in
lt-proc to output n-best paths using the weight values.

Closes apertium#3
Techievena added a commit to Techievena/lttoolbox that referenced this issue Jun 24, 2018
Using the same option names as `hfst-proc` we add options in
lt-proc to output n-best paths using the weight values.

Closes apertium#3
Techievena added a commit to Techievena/lttoolbox that referenced this issue Jun 24, 2018
Using the same option names as `hfst-proc` we add options in
lt-proc to output n-best paths using the weight values.

Closes apertium#3
Techievena added a commit to Techievena/lttoolbox that referenced this issue Jun 24, 2018
Using the same option names as `hfst-proc` we add options in
lt-proc to output n-best paths using the weight values.

Closes apertium#3
Techievena added a commit to Techievena/lttoolbox that referenced this issue Jun 26, 2018
Using the same option names as `hfst-proc` we add options in
lt-proc to output n-best paths using the weight values.

Closes apertium#3
Techievena added a commit to Techievena/lttoolbox that referenced this issue Jun 27, 2018
Using the same option names as `hfst-proc` we add options in
lt-proc to output n-best paths using the weight values.

Closes apertium#3
Techievena added a commit to Techievena/lttoolbox that referenced this issue Jun 29, 2018
Using the same option names as `hfst-proc` we add options in
lt-proc to output n-best paths using the weight values.

Closes apertium#3
Techievena added a commit to Techievena/apertium-lex-tools that referenced this issue Jun 29, 2018
Make necessary modifications in apertium-lex-tools to be
compatible with the new lttoolbox.

Related to apertium/lttoolbox#3
Techievena added a commit to Techievena/lttoolbox that referenced this issue Jun 29, 2018
Using the same option names as `hfst-proc` we add options in
lt-proc to output n-best paths using the weight values.

Closes apertium#3
Techievena added a commit to Techievena/lttoolbox that referenced this issue Jun 30, 2018
Using the same option names as `hfst-proc` we add options in
lt-proc to output n-best paths using the weight values.

Closes apertium#3
Techievena added a commit to Techievena/lttoolbox that referenced this issue Jul 1, 2018
Using the same option names as `hfst-proc` we add options in
lt-proc to output n-best paths using the weight values.

Closes apertium#3
Techievena added a commit to Techievena/lttoolbox that referenced this issue Jul 1, 2018
Using the same option names as `hfst-proc` we add options in
lt-proc to output n-best paths using the weight values.

Closes apertium#3
Techievena added a commit to Techievena/lttoolbox that referenced this issue Jul 1, 2018
Using the same option names as `hfst-proc` we add options in
lt-proc to output n-best paths using the weight values.

Closes apertium#3
Techievena added a commit to Techievena/lttoolbox that referenced this issue Jul 5, 2018
Using the same option names as `hfst-proc` we add options in
lt-proc to output n-best paths using the weight values.

Closes apertium#3
Techievena added a commit to Techievena/lttoolbox that referenced this issue Jul 31, 2018
…on to output n-best paths.

Make all the tweaks necessary to have a minimal implementation
of weights in att_compiler.
Using the same option names as `hfst-proc` we add options in
lt-proc to output n-best paths using the weight values.

Closes apertium#2
Closes apertium#3
Fixes apertium#12
Techievena added a commit to Techievena/apertium that referenced this issue Jul 31, 2018
…on to output n-best paths.

Make all the tweaks necessary to have a minimal implementation
of weights in att_compiler.
Using the same option names as `hfst-proc` we add options in
lt-proc to output n-best paths using the weight values.

Closes apertium/lttoolbox#2
Closes apertium/lttoolbox#3
Fixes apertium/lttoolbox#12
Techievena added a commit to Techievena/apertium-lex-tools that referenced this issue Jul 31, 2018
…on to output n-best paths.

Make all the tweaks necessary to have a minimal implementation
of weights in att_compiler.
Using the same option names as `hfst-proc` we add options in
lt-proc to output n-best paths using the weight values.

Closes apertium/lttoolbox#2
Closes apertium/lttoolbox#3
Fixes apertium/lttoolbox#12
Techievena added a commit to Techievena/lttoolbox that referenced this issue Jul 31, 2018
Make all the tweaks necessary to have a minimal implementation
of weights in att_compiler.
Using the same option names as `hfst-proc` we add options in
lt-proc to output n-best paths using the weight values.

Closes apertium#2
Closes apertium#3
Fixes apertium#12
Techievena added a commit to Techievena/apertium that referenced this issue Jul 31, 2018
Make all the tweaks necessary to have a minimal implementation
of weights in att_compiler.
Using the same option names as `hfst-proc` we add options in
lt-proc to output n-best paths using the weight values.

Closes apertium/lttoolbox#2
Closes apertium/lttoolbox#3
Fixes apertium/lttoolbox#12
Techievena added a commit to Techievena/apertium-lex-tools that referenced this issue Jul 31, 2018
Make all the tweaks necessary to have a minimal implementation
of weights in att_compiler.
Using the same option names as `hfst-proc` we add options in
lt-proc to output n-best paths using the weight values.

Closes apertium/lttoolbox#2
Closes apertium/lttoolbox#3
Fixes apertium/lttoolbox#12
Techievena added a commit to Techievena/lttoolbox that referenced this issue Jul 31, 2018
Make all the tweaks necessary to have a minimal implementation
of weights in att_compiler.
Using the same option names as `hfst-proc` we add options in
lt-proc to output n-best paths using the weight values.

Closes apertium#2
Closes apertium#3
Fixes apertium#12
TinoDidriksen pushed a commit to apertium/apertium-lex-tools that referenced this issue Sep 16, 2019
Make necessary modifications in apertium-lex-tools to be
compatible with the new lttoolbox.

Related to apertium/lttoolbox#3
TinoDidriksen pushed a commit to apertium/apertium-lex-tools that referenced this issue Sep 16, 2019
Make all the tweaks necessary to have a minimal implementation
of weights in att_compiler.
Using the same option names as `hfst-proc` we add options in
lt-proc to output n-best paths using the weight values.

Closes apertium/lttoolbox#2
Closes apertium/lttoolbox#3
Fixes apertium/lttoolbox#12
vivekvardhanadepu pushed a commit to vivekvardhanadepu/apertium-lex-tools that referenced this issue Jul 11, 2021
Make all the tweaks necessary to have a minimal implementation
of weights in att_compiler.
Using the same option names as `hfst-proc` we add options in
lt-proc to output n-best paths using the weight values.

Closes apertium/lttoolbox#2
Closes apertium/lttoolbox#3
Fixes apertium/lttoolbox#12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants