You need to enable JavaScript to run this app. AllenNLP语义角色标注对含be动词简单句返回空结果的版本兼容问题
优惠活动
大模型
产品
解决方案
定价
更多

AllenNLP语义角色标注对含be动词简单句返回空结果的版本兼容问题

AllenNLP 语义角色标注含be动词简单句无标注输出问题

问题现象

使用AllenNLP开展语义角色标注(SRL)工作时,无论通过官方在线演示页面,还是在Python 3.8环境下调用2020年11月发布的BERT-base SRL模型,所有包含be动词(is/am/are)的简单句式均无法返回任何标注结果,例如输入"I am here."时程序无有效输出。
核心问题清单:

  • 所有"A is B"结构的简单句调用SRL功能时,均无法返回任何结果
  • 其他同类型SRL引擎针对这类句式可正常输出标注,按照预期AllenNLP也应返回对应结果,例如输入"I am."时,预期标注为"I"对应语义角色ARG1,"am"为谓词
  • 该功能此前在allennlp==1.0.0、allennlp-models==1.0.0版本下可正常运行

测试环境

  • 操作系统:macOS 10.15.7(Catalina)
  • Python版本:3.8.6(通过Homebrew安装)

本地依赖版本列表:

allennlp==1.2.2
allennlp-models==1.2.2
attrs==20.3.0
blis==0.4.1
boto3==1.16.24
botocore==1.19.24
catalogue==1.0.0
certifi==2020.11.8
chardet==3.0.4
click==7.1.2
conllu==4.2.1
cymem==2.0.4
dataclasses==0.6
filelock==3.0.12
ftfy==5.8
future==0.18.2
h5py==3.1.0
idna==2.10
importlib-metadata==3.1.0
iniconfig==1.1.1
jmespath==0.10.0
joblib==0.17.0
jsonnet==0.17.0
jsonpickle==1.4.1
murmurhash==1.0.4
nltk==3.5
numpy==1.19.4
overrides==3.1.0
packaging==20.4
plac==1.1.3
pluggy==0.13.1
preshed==3.0.4
protobuf==3.14.0
py==1.9.0
py-rouge==1.1
pyparsing==2.4.7
pytest==6.1.2
python-dateutil==2.8.1
regex==2020.11.13
requests==2.25.0
s3transfer==0.3.3
sacremoses==0.0.43
scikit-learn==0.23.2
scipy==1.5.4
sentencepiece==0.1.91
six==1.15.0
spacy==2.3.2
srsly==1.0.4
tensorboardX==2.1
thinc==7.4.1
threadpoolctl==2.1.0
tokenizers==0.9.3
toml==0.10.2
torch==1.7.0
tqdm==4.53.0
transformers==3.5.1
typing-extensions==3.7.4.3
urllib3==1.26.2
wasabi==0.8.0
wcwidth==0.2.5
word2number==1.1
zipp==3.4.0

复现步骤

  • 访问AllenNLP官方SRL演示页面,输入任意含be动词的简单句,如"I am here.""We are people.""I am.",观察无标注结果返回
  • 或在本地执行如下代码,同样无法得到有效输出:
from allennlp.predictors.predictor import Predictor

allen_predictor_srl = Predictor.from_path(
    "./models/bert-base-srl-2020.11.19.tar.gz"
)

output = allen_predictor_srl.predict(sentence="I am here.")
print(output)
# 运行后无有效输出

已开展的排查进展

  • 已尝试安装此前可正常运行的allennlp==1.0.0版本,问题依旧存在
  • 严格按照如下环境初始化脚本完成环境搭建后,问题仍未解决:
python3 -m venv env
source ./env/bin/activate

pip3 install --upgrade pip
pip3 install -U --no-cache-dir
pip3 install -U allennlp allennlp-models --no-cache-dir

python3 -m spacy download en_core_web_lg --no-cache-dir
python3 -m spacy download en_core_web_sm --no-cache-dir
python3 -m spacy download en_vectors_web_lg --no-cache-dir
python3 -m spacy download de_core_news_md --no-cache-dir

当前诉求

目前该问题影响正常使用,需要明确问题成因的排查指引与对应修复方案。


内容的提问来源于stack exchange,提问作者synchronizer

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.11.16 12:45:03