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

Can't import the tokenizer #8

Open
RAHAMNIabdelkaderseifelislem opened this issue Mar 25, 2023 · 0 comments
Open

Can't import the tokenizer #8

RAHAMNIabdelkaderseifelislem opened this issue Mar 25, 2023 · 0 comments

Comments

@RAHAMNIabdelkaderseifelislem

when I tried to launch the code

import tkseem as tk
import csv

# initialize the tokenizer
tokenizer = tk.WordTokenizer()
tokenizer.train('data.txt')
# open the csv file and read the text data
with open('../uploads/tweets-ar.csv', mode='r', encoding='utf-8') as csv_file:
    csv_reader = csv.reader(csv_file)
    for row in csv_reader:
        text = row[0]
        # tokenize the text using tkseem
        tokens = tokenizer.tokenize(text)
        print(tokens)

i got this error

File "pathtomycode\tokenize.py", line 5, in <module>
    tokenizer = tk.WordTokenizer()
AttributeError: partially initialized module 'tkseem' has no attribute 'WordTokenizer' (most likely due to a circular import)
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

1 participant