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

数据增强部分应用自己数据集出现问题re.error: missing ), unterminated subpattern at position 0 #59

Open
ottt08 opened this issue Mar 28, 2024 · 2 comments

Comments

@ottt08
Copy link

ottt08 commented Mar 28, 2024

作者您好,在数据增强实例部分我想增强自己的数据集在进行数据转换时会报错,且我不知道应如何解决
Traceback (most recent call last):
File "e:\DAIMA\pytorch_bert_bilstm_crf_ner-main\data\cner\raw_data\process.py", line 94, in
preprocess("data/ecommerce/raw_data/bdev.txt", 'data/ecommerce/mid_data', "train")
File "e:\DAIMA\pytorch_bert_bilstm_crf_ner-main\data\cner\raw_data\process.py", line 64, in preprocess
for span in re.finditer(ent, text):
File "C:\Users\10553\AppData\Local\Programs\Python\Python39\lib\re.py", line 248, in finditer
return _compile(pattern, flags).finditer(string)
File "C:\Users\10553\AppData\Local\Programs\Python\Python39\lib\re.py", line 304, in _compile
p = sre_compile.compile(pattern, flags)
File "C:\Users\10553\AppData\Local\Programs\Python\Python39\lib\sre_compile.py", line 788, in compile
p = sre_parse.parse(p, flags)
File "C:\Users\10553\AppData\Local\Programs\Python\Python39\lib\sre_parse.py", line 955, in parse
p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0)
File "C:\Users\10553\AppData\Local\Programs\Python\Python39\lib\sre_parse.py", line 444, in _parse_sub
itemsappend(_parse(source, state, verbose, nested + 1,
File "C:\Users\10553\AppData\Local\Programs\Python\Python39\lib\sre_parse.py", line 843, in _parse
raise source.error("missing ), unterminated subpattern",
re.error: missing ), unterminated subpattern at position 0

@ottt08
Copy link
Author

ottt08 commented Mar 28, 2024

补充:是在raw_data下的process.py部分

@taishan1994
Copy link
Owner

在进行正则表达式提取的时候有问题,可以把这些数据过滤掉

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