Natural-Language-Processing-Tutorials icon indicating copy to clipboard operation
Natural-Language-Processing-Tutorials copied to clipboard

@plac.annotations - SyntaxError

Open avissens opened this issue 6 years ago • 6 comments

Hi! @plac.annotations cell gives me this error:

File "<ipython-input-293-72f554ad94b1>", line 5 n_iter=("Number of training iterations", "option", "n", int)) ^ SyntaxError: unexpected EOF while parsing

Any suggestion why? I'm using Python 3.

avissens avatar Sep 17 '18 21:09 avissens

Removing the plac.annotations decorator and converting plac.call(main) into main() might do the trick. im guessing its a similar syntax error when run on jupyter-notebook. https://stackoverflow.com/questions/52384517/training-a-new-entity-type-with-spacy

kwokfong29 avatar Feb 24 '19 16:02 kwokfong29

I am facing the same error , I want to execute (https://github.com/explosion/spaCy/tree/master/examples/training)

this in Google colab or Jupyter. How to remove the plac.annotations

Shrivarsheni avatar Jun 09 '20 14:06 Shrivarsheni

Removing the plac.annotations decorator and converting plac.call(main) into main() might do the trick. im guessing its a similar syntax error when run on jupyter-notebook. https://stackoverflow.com/questions/52384517/training-a-new-entity-type-with-spacy

Could you show an example of this?

pranay-anchan avatar Jul 06 '20 20:07 pranay-anchan

Removing the plac.annotations decorator and converting plac.call(main) into main() might do the trick. im guessing its a similar syntax error when run on jupyter-notebook. https://stackoverflow.com/questions/52384517/training-a-new-entity-type-with-spacy

Could you show an example of this?

I am afraid I can't do that anymore, the document I was working on got overwritten a year ago. But if you have any issues, would be happy to help

kwokfong29 avatar Jul 16 '20 15:07 kwokfong29

Removing the plac.annotations decorator and converting plac.call(main) into main() might do the trick. im guessing its a similar syntax error when run on jupyter-notebook. https://stackoverflow.com/questions/52384517/training-a-new-entity-type-with-spacy

Could you show an example of this?

I am afraid I can't do that anymore, the document I was working on got overwritten a year ago. But if you have any issues, would be happy t

Removing the plac.annotations decorator and converting plac.call(main) into main() might do the trick. im guessing its a similar syntax error when run on jupyter-notebook. https://stackoverflow.com/questions/52384517/training-a-new-entity-type-with-spacy

Could you show an example of this?

I am afraid I can't do that anymore, the document I was working on got overwritten a year ago. But if you have any issues, would be happy to help

I am still not getting about main(). can you show a piece of code?

MahimaBarot avatar Jun 05 '21 08:06 MahimaBarot

@MahimaBarot would love to, but as mentioned above, the documents I have worked on got overwritten. Plus, the python script provided by the developers are no longer available. If you have a sample script that you were working on then that would be helpful...

At best, the last I could recall and any resemblance of the code at the end looks something like this.

if __name__ == '__main__':
    import plac
    plac.call(main)

drop the plac.call function and call the main function directly, as such.

if __name__ == '__main__':
    main()

kwokfong29 avatar Jun 05 '21 16:06 kwokfong29