Code Monkey home page Code Monkey logo

Comments (3)

wangpd avatar wangpd commented on August 19, 2024

Hi,

I am thinking whether you made a typo in your python client which caused
the problem.
In the following function, I guess you want to use "text" (the argument to

the function) instead of "l" on Line 3:

def translate_thread(text):
proxy_n = xmlrpclib.ServerProxy(moses_url)
response = proxy_n.translate({'text': l})

print(response['text'])

, as the "l" is from the main thread and it could be any arbitrary sentence.

Hope it helps.

Best wishes!
Pidong

On 30 July 2015 at 12:17, cidermole [email protected] wrote:

When trying to feed Moses via XML-RPC with 32 sentences to translate in
parallel, it returns occasional duplicates. Depending on the method to do
the threading in Python, sometimes Moses blocks on and never replies to
XML-RPC requests.

Standalone Python3 script to feed XML-RPC and trigger this bug:
http://pastebin.com/fJdGQywq

Moses config (pretty straightforward, CBPT enabled [1]).
http://pastebin.com/rmtLdxFg

Script results (32 lines, but note the duplicates):
http://pastebin.com/1E42ngD7

Expected script results (no duplicates):
http://pastebin.com/gRZ1QuGa

(obtained without threading, by waiting for each request as follows)

for l in emea_en[0:32]:
t = threading.Thread(target=translate_thread, args=(l,))
t.start()
t.join()

[1] http://www.statmt.org/moses/?n=Advanced.CacheBased


Reply to this email directly or view it on GitHub
#120.

from mosesdecoder.

cidermole avatar cidermole commented on August 19, 2024

Ouch. This one was really obvious, thank you.

I'm still wondering why the other attempt of mine is blocking indefinitely...

But indeed, this looks like it has nothing to do with Moses.

from mosesdecoder.

wangpd avatar wangpd commented on August 19, 2024

You are welcome.

Best wishes!
Pidong

On 30 July 2015 at 14:32, cidermole [email protected] wrote:

Ouch. This one was really obvious, thank you.

I'm still wondering why the other attempt of mine is blocking
indefinitely...

But indeed, this looks like it has nothing to do with Moses.


Reply to this email directly or view it on GitHub
#120 (comment)
.

from mosesdecoder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.