Method run4doc([class gate.creole.ConditionalSerialAnalyserController, class gate.corpora.DocumentImpl]) does not exist ?? #121
Replies: 2 comments 2 replies
-
Could you please give all the details of your environment, Java version, gatenlp version, Python version, operating system and version. Also specify how you create all the variables involved in your problem, e.g. pipeline. I have tested this here with the most recent gatenlp version on Linux and it worked. With that version GateWorker has convenience methods like e.g. It may also help to first try the same using a trivial case:
|
Beta Was this translation helpful? Give feedback.
-
Details of my environnementGatenlp version : 1.0.4 GATE version : 9.1-SNAPSHOT JAVA version : openjdk version "11.0.10" 2021-01-19 Python version: 3.9.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)] I use windows 10. Running a simple use case of gate worker and run4doc| Code | from gatenlp.gateworker import GateWorker
gs = GateWorker()
print("worker started")
pipeline = gs.worker.loadPipelineFromFile(r"C:\Users\robin\Documents\Xxxxx\SSDD\Gate\Enumeration\tests\application.xgapp")
print("pipeline loaded")
doc = gs.worker.createDocument("Some document text")
print("doc created")
gs.worker.run4doc(pipeline,doc)
print("pipeline running")
pdoc = gs.gdoc2pdoc(doc)
gs.worker.deleteResource(doc)
gs.close()
print("worker closed") | prints and error message | Trying to start GATE Worker on port=25333 host=127.0.0.1 log=false keep=false
Process id is 13192
PythonWorkerRunner.java: starting server with 25333/127.0.0.1/X-BLh7aLc6S_mjUUca53fzPpkgE/false
worker started
pipeline loaded
doc created
---------------------------------------------------------------------------
Py4JError Traceback (most recent call last)
<ipython-input-1-1178d4c5a643> in <module>
6 doc = gs.worker.createDocument("Some document text")
7 print("doc created")
----> 8 gs.worker.run4doc(pipeline,doc)
9 print("pipeline running")
10 pdoc = gs.gdoc2pdoc(doc)
~\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\py4j\java_gateway.py in __call__(self, *args)
1307
1308 answer = self.gateway_client.send_command(command)
-> 1309 return_value = get_return_value(
1310 answer, self.gateway_client, self.target_id, self.name)
1311
~\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\py4j\protocol.py in get_return_value(answer, gateway_client, target_id, name)
328 format(target_id, ".", name), value)
329 else:
--> 330 raise Py4JError(
331 "An error occurred while calling {0}{1}{2}. Trace:\n{3}\n".
332 format(target_id, ".", name, value))
Py4JError: An error occurred while calling t.run4doc. Trace:
py4j.Py4JException: Method run4doc([class gate.creole.ConditionalSerialAnalyserController, class gate.corpora.DocumentImpl]) does not exist
at py4j.reflection.ReflectionEngine.getMethod(ReflectionEngine.java:318)
at py4j.reflection.ReflectionEngine.getMethod(ReflectionEngine.java:326)
at py4j.Gateway.invoke(Gateway.java:274)
at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132)
at py4j.commands.CallCommand.execute(CallCommand.java:79)
at py4j.GatewayConnection.run(GatewayConnection.java:238)
at java.base/java.lang.Thread.run(Thread.java:834) Thank you very much |
Beta Was this translation helpful? Give feedback.
-
Hi everyone, and sorry for the barbaric title 🙇♂️
As you might have guessed, I obtain such an error
After loading a pipeline and a corpus of XML documents in a list, I'm trying to process each documents with the method run4doc().
Here is the line with triggers the error with those around
Full error message
Do you have any ideas on how to solve this issue, or what methods of the python-gatenlp plugin I can leverage to avoid using run4doc ?
Thanks a lot
Beta Was this translation helpful? Give feedback.
All reactions