Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Too many log messages causes an interrupt #17

Open
bilative opened this issue Jan 24, 2022 · 2 comments
Open

Too many log messages causes an interrupt #17

bilative opened this issue Jan 24, 2022 · 2 comments

Comments

@bilative
Copy link

Hi,
I dont know if there is a way to cancel them I dont know but I hav problem with this.

actually I dont have so many sentences. I work with 250 lines of data. And in every line there is only 1 or 2 sentences. But after I run my loop, jupiter is interrapted bc there is so many logs. Is there any way to cancel logs?

cleansent = []
for sent in senteces:
     clean_sent =[]
     for word in sent:
          if word != “”:
               lemword = analyzer.lemmatize(word)
               clean_sent.append(lemword[0][1][0])
          lemsent.append(cleansent)

As I said log messages cause a interrupt :/

@bilative
Copy link
Author

bilative commented Feb 21, 2022

Hi again,
I found a tricky solution to my problem. Like this:

from IPython.display import clear_output

cleansent = []
for sent in senteces:
     clean_sent =[]
     for word in sent:
          if word != “”:
               lemword = analyzer.lemmatize(word)
               clean_sent.append(lemword[0][1][0])

               clear_output(wait=True)
          lemsent.append(cleansent)

I couldn't prevent the logs but this method clean the outputs immediately in every iteration, So my code run well with thousand rows of data.

BUT: if there is any other clean way to ignore logs, I wanna hear it.

@HarikalarKutusu
Copy link

@bilative, in your own program you can use this to ignore lower-level logging from zeyrek:

import logging
logging.getLogger("zeyrek").setLevel(logging.ERROR)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants