Code Monkey home page Code Monkey logo

epub2anki's Introduction

epub2anki's People

Contributors

whateverforever avatar

Watchers

 avatar  avatar

epub2anki's Issues

NLP Errors not propagated to GUI

For example when input is too large, the user doesn't notice that something happened

(base) ➜  epub2anki git:(main) ✗ python app.py
INFO: Searching for database. This might take some time. You can speed this up by specifying a search path or directly entering the path to your database.
WARNING: The search will stop at the first hit, so please verify that the result is correct (for example in case there might be more than one Anki installation)
INFO: Loaded db from /Users/max/Library/Application Support/Anki2/User 1/collection.anki2
INFO: Loaded db from /Users/max/Library/Application Support/Anki2/User 1/collection.anki2
[Cocoa] Not implemented: MultilineTextInput.set_on_change()
INFO: Loaded db from /Users/max/Library/Application Support/Anki2/User 1/collection.anki2
Error in async handler: [E088] Text of length 3435600 exceeds maximum of 400000. The v2.x parser and NER models require roughly 1GB of temporary memory per 100,000 characters in the input. This means long texts may cause memory allocation errors. If you're not using the parser or NER, it's probably safe to increase the `nlp.max_length` limit. The limit is in number of characters, so you can check whether your inputs are too long by checking `len(text)`.
Traceback (most recent call last):
  File "/Users/max/anaconda3/lib/python3.7/site-packages/toga/handlers.py", line 25, in handler_with_cleanup
    await handler(interface, *args, **kwargs)
  File "app.py", line 270, in do_background_nlp_stuff
    out = await loop.run_in_executor(None, step_fun, screen._state)
  File "/Users/max/anaconda3/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "app.py", line 178, in step_nlp_epub
    doc_epub = state["nlp_module"].lemmatize_doc(state["epub_contents"])
  File "/Users/max/Coding/python/epub2anki/nlp/french/nlp_french.py", line 19, in lemmatize_doc
    doc = model(partially_french_text)
  File "/Users/max/anaconda3/lib/python3.7/site-packages/spacy/language.py", line 439, in __call__
    Errors.E088.format(length=len(text), max_length=self.max_length)
ValueError: [E088] Text of length 3435600 exceeds maximum of 400000. The v2.x parser and NER models require roughly 1GB of temporary memory per 100,000 characters in the input. This means long texts may cause memory allocation errors. If you're not using the parser or NER, it's probably safe to increase the `nlp.max_length` limit. The limit is in number of characters, so you can check whether your inputs are too long by checking `len(text)`.

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.