Well... in that case... let me deal with the reordering part. I will update you if I manage that. Thanks once again.
On Thu, Nov 27, 2014 at 10:05 PM, Marcin Junczys-Dowmunt <[email protected] > wrote: > Hi Raj, > > Unfortunately there's no interface to the reordering model. If you need > help with the C++ part let me know. My experience with JNI however is > confined to what you are seeing. And what's worse, I did that two years ago > and by today I hardly understand what is going on there. I must have been > way smarter back then than I am now (I even managed to convince bjam to run > ant and create java classes!). > > W dniu 2014-11-27 13:43, Raj Dabre napisał(a): > > Marcin, > > I just finished installing everything and the code works like a charm. I > did have to modify the LD_LIBRARY_PATH since libcmph.so.0 did not get > linked to libJniQueryPt.so in the lib folder. But thats a small thing. > I will study the code in detail and try to make it work for querying the > reordering models also (Unless that is also taken care of???). > If you have anything new you wanted to add to this then please let me know. > Some experience in JNI would help a Java programmer like me play with the > internals of moses. > > Thanks again. > > On Thu, Nov 27, 2014 at 8:03 PM, Marcin Junczys-Dowmunt < > [email protected]> wrote: > >> The code in the wipo branch is not segfaulting, it's just an old moses >> version. I can put my recent attempts to make it run with current master >> into a separate branch (that's segfaulting). It's best if you start there >> when you try to fix it. I will let you know once I pushed it. Probably this >> evening. >> >> W dniu 2014-11-27 11:57, Raj Dabre napisał(a): >> >> Hello Marcin, >> >> You just saved me a lot of time since I was planning to write this code >> from scratch. Many thanks for that. >> I will try to fix the reasons for the segfaults. >> >> Many thanks again! >> >> Regards. >> >> On Thu, Nov 27, 2014 at 7:43 PM, Marcin Junczys-Dowmunt < >> [email protected]> wrote: >> >>> Hi, >>> >>> I tried to port it to the newest Moses version, but I still get >>> segfaults. This used to work with Moses 1.* before the feature function >>> format was changed. However, since the binary format of the compact phrase >>> table has not changed since then, just use the old interface. >>> >>> Checkout the "wipo" branch (not wipoNew!) and compile with >>> >>> ./bjam --with-cmph=/usr/include -j8 >>> --with-java=/usr/lib/jvm/java-7-openjdk-amd64 >>> >>> You see you need to specifiy the location of your Java includes, >>> specifically the directories jni.h resides in. This should build the stuff >>> in misc/jni/* including java classes and stuff. You need ant for that. Then >>> you can run the query tool like this: >>> >>> echo "test" | ./bin/JniQueryPt_example.sh >>> /some_path/phrase-table.0-0.minphr 4 >>> >>> You need to specify the path and the number of scores in the phrase >>> table. Look inside JniQueryPt_example.sh how to call the jar and inside >>> misc/jni/java/example.java how to call the code directly from Java. I >>> apologize for the code, I am not a Java programmer, so this may be crude. >>> >>> Best, >>> >>> Marcin >>> >>> W dniu 2014-11-26 12:00, Raj Dabre napisał(a): >>> >>> Hello Marcin, >>> >>> Yes please. >>> It would save me lots of time. >>> Thanks. >>> >>> Regards. >>> >>> On Wed, Nov 26, 2014 at 6:50 PM, Marcin Junczys-Dowmunt < >>> [email protected]> wrote: >>> >>>> Hi, >>>> >>>> I have a JNI interface to my compact phrase table somewhere, I guess I >>>> can put that in contrib within a day or two if there is interest. >>>> >>>> best, >>>> >>>> Marcin >>>> >>>> W dniu 2014-11-26 10:45, Barry Haddow napisał(a): >>>> >>>> Hi Raj >>>> >>>> The format of these tables is not described anywhere. You'd have to read >>>> the code in moses/TranslationModel/PhraseDictionaryTree.cpp, and then >>>> try to convert it it Java. >>>> >>>> A better plan would be to use JNI to call the C++ code -- a similar >>>> approach has been followed in the python interface in contrib/python. >>>> This would insulate you from the low-level details, and from changes in >>>> the format, >>>> >>>> cheers - Barry >>>> >>>> On 26/11/14 03:22, Raj Dabre wrote: >>>> >>>> Hello All, I know that Moses allows for binarization of a phrase table >>>> which can be read on demand at decoding time. We get 5 files named: >>>> phrase-table.binphr.* I want to write my own routine in Java to read phrase >>>> pairs from these on demand. Can anyone guide me ? PS: If an explanation of >>>> the same for binary reordering tables can be done then it would be great >>>> too. Thanks in advance. -- Raj Dabre. Research Student, Graduate >>>> School of Informatics, Kyoto University. CSE MTech, IITB., 2011-2014 >>>> _______________________________________________ Moses-support mailing list >>>> [email protected] >>>> http://mailman.mit.edu/mailman/listinfo/moses-support >>>> >>>> >>>> >>>> >>>> _______________________________________________ >>>> Moses-support mailing list >>>> [email protected] >>>> http://mailman.mit.edu/mailman/listinfo/moses-support >>>> >>>> >>> >>> >>> -- >>> Raj Dabre. >>> Research Student, >>> Graduate School of Informatics, >>> Kyoto University. >>> CSE MTech, IITB., 2011-2014 >>> >>> >>> >>> >> >> >> >> -- >> Raj Dabre. >> Research Student, >> Graduate School of Informatics, >> Kyoto University. >> CSE MTech, IITB., 2011-2014 >> >> >> >> > > > > -- > Raj Dabre. > Research Student, > Graduate School of Informatics, > Kyoto University. > CSE MTech, IITB., 2011-2014 > > > > -- Raj Dabre. Research Student, Graduate School of Informatics, Kyoto University. CSE MTech, IITB., 2011-2014
_______________________________________________ Moses-support mailing list [email protected] http://mailman.mit.edu/mailman/listinfo/moses-support
