Thanks, Hieu. Here is the answer I ended up finding myself. Please correct me
if I’m wrong.
1. yes.
2. I cannot say about other properties, but for Tree property,
ChartParser.cpp:120-121 listed several conditions where this property will be
loaded:
if (!options()->output.detailed_tree_transrep_filepath.empty() ||
options()->nbest.print_trees || staticData.GetTreeStructure() != NULL) {
...
targetPhrase->SetProperty("Tree", prop);
}
which seems to mean unless you are using TreeStructureFeature, or you turned on
some specific options, you cannot access this property through TargetPhrase.
(That’s actually my “real” problem last night — tp->GetProperty(“Tree”)
returned a null pointer, and adding TreeStructureFeature solved it).
Shuoyang
> On Feb 26, 2017, at 3:18 PM, Hieu Hoang <[email protected]> wrote:
>
> Hiya
>
> Hieu Hoang
> http://moses-smt.org/ <http://moses-smt.org/>
>
> On 25 February 2017 at 23:22, Shuoyang Ding <[email protected]
> <mailto:[email protected]>> wrote:
> Hi All,
>
> In http://www.statmt.org/moses/?n=FactoredTraining.ScorePhrases
> <http://www.statmt.org/moses/?n=FactoredTraining.ScorePhrases>, it was
> mentioned that there is a key-value pair field at the end of each entry of
> the phrase table. Now I have a phrase table that looks like the following:
>
> , [X] ||| to the outside world [PP] ||| 0.00202802 0.0962381 1.14287e-06
> 7.14872e-10 0.00284822 0.367879 ||| 0-0 ||| 6 10647 1 ||| ||| {{Tree [PP [TO
> to] [NP [DT the] [JJ outside] [NN world]]]}}
>
> where the last field looks like the key-value pair field as described.
>
> My question is the following:
>
> 1. how can I get access to the contents in this field? e.g. suppose tp is a
> TargetPhrase instance, is tp->GetProperty(“Tree”) the right way to do it?
> yep
> 2. is the content of this field always loaded when initializing the decoder?
> I think so, however, you must use PhraseDictionary or PhraseDictionaryOnDisk.
> The other phrase-table implementation doesn't support it
>
> Thanks!
>
> Regards,
> Shuoyang Ding
>
> Ph.D. Student
> Center for Language and Speech Processing
> Department of Computer Science
> Johns Hopkins University
>
> Hackerman Hall 225A
> 3400 N. Charles St.
> Baltimore, MD 21218
>
> http://cs.jhu.edu/~sding <http://cs.jhu.edu/~sding>
>
> _______________________________________________
> Moses-support mailing list
> [email protected] <mailto:[email protected]>
> http://mailman.mit.edu/mailman/listinfo/moses-support
> <http://mailman.mit.edu/mailman/listinfo/moses-support>
_______________________________________________
Moses-support mailing list
[email protected]
http://mailman.mit.edu/mailman/listinfo/moses-support