Can't import the tokenizer
还没有人认领这个 Issue。
评估
调研方向
首先复现报告中的 tokenize.py 示例的导入,并检查 tkseem 如何公开 WordTokenizer。先检查导入路径和包入口点,然后验证该示例能否初始化 tokenizer、使用 data.txt 进行训练,并在不出现所报告的 AttributeError 的情况下完成对 CSV 输入的分词。
由索引模型根据 Issue 内容生成。
描述
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)
- 主要语言
- Jupyter Notebook
- 星标
- 113
- 派生
- 22
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ARBML/tkseem 的其他 Issue
-
paper未关闭
难度 2/5 1-3 小时 新手友好度 35/100
-
难度 2/5 1-3 小时 新手友好度 50/100
-
难度 5/5 一周以上 新手友好度 15/100
-
بحث عن تقسيم未关闭
难度 4/5 3-5 天 新手友好度 15/100
相似的 Issue
-
bug severity:low
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 2 天内回复
-
needs-triage
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
No Code Attached Yet
难度 1/5 1 小时以内 新手友好度 90/100
joomla/joomla-cms#48786 ·
维护者通常 1 天内回复
-
Type: Bug
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 77/100
eyalgolan/statecraft-israel#2732 ·
维护者通常 1 天内回复