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

Jupyter Notebook: Future Warning possible nested set #3

Closed
vizzerdrix55 opened this issue Jun 15, 2019 · 1 comment
Closed

Jupyter Notebook: Future Warning possible nested set #3

vizzerdrix55 opened this issue Jun 15, 2019 · 1 comment

Comments

@vizzerdrix55
Copy link

I use SoMeWeTa in Jupyter Notebook 5.7.4 with Python 3.7.1. I Installed SoMeWeTa in Jupyter Notebook using

import sys
!{sys.executable} -m pip install -U SoMeWeTa

When I try to run the following test code I found under Using the Module

from someweta import ASPTagger

model = "german_web_social_media_2018-12-21.model"
sentences = [["Ein", "Satz", "ist", "eine", "Liste", "von", "Tokens", "."],
             ["Zeitfliegen", "mögen", "einen", "Pfeil", "."]]

# future versions will have sensible default values
asptagger = ASPTagger(beam_size=5, iterations=10)
asptagger.load(model)

The output contains multiple errors that look like this:

/anaconda3/lib/python3.7/site-packages/someweta/tagger.py:30: FutureWarning: Possible nested set at position 2
self.email = re.compile(r"^[[:alnum:].%+-]+(?:@| [?at]? )[[:alnum:].-]+(?:.| [?dot]? )[[:alpha:]]{2,}$", re.IGNORECASE)
/anaconda3/lib/python3.7/site-packages/someweta/tagger.py:30: FutureWarning: Possible nested set at position 34
self.email = re.compile(r"^[[:alnum:].%+-]+(?:@| [?at]? )[[:alnum:].-]+(?:.| [?dot]? )[[:alpha:]]{2,}$", re.IGNORECASE)
/anaconda3/lib/python3.7/site-packages/someweta/tagger.py:30: FutureWarning: Possible nested set at position 66
self.email = re.compile(r"^[[:alnum:].%+-]+(?:@| [?at]? )[[:alnum:].-]+(?:.| [?dot]? )[[:alpha:]]{2,}$", re.IGNORECASE)

Actually, everything seems to work correctly: I tested the following code:

for sentence in sentences:
    tagged_sentence = asptagger.tag_sentence(sentence)
    print("\n".join(["\t".join(t) for t in tagged_sentence]), "\n", sep="")

which gave the following correct output:

Ein ART
Satz NN
ist VAFIN
eine ART
Liste NN
von APPR
Tokens NN
. $.

Zeitfliegen NN
mögen VMFIN
einen ART
Pfeil NN
. $.

It might be useful for other users to fix this (maybe with adding an explicit installation guide for Jupyter Notebook)

@tsproisl
Copy link
Owner

Thank you for pointing that out! Fixed in version 1.5.1.

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