Code Monkey home page Code Monkey logo

pref-fend's People

Contributors

rmsnow avatar sheng-qiang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pref-fend's Issues

The lack of dataset

Dear Zhang Xue Yao: I am a master student in SEU, and my research derection is in line with yours.Your paper "Pref-FEND"is quite well-wirtten, and I want to reproduce the result in this article. But I can't find the dataset refered in the article .I will appreciate it if you can kindly send me the dataset(including social media posts and relevant articles, named "Weibo Dataset" and "Twitter Dataset").I assure you that the dataset is for academic use only.Thanks so much~!

运行Bert-emo(单独的和融合的报错)模型时报错

Traceback (most recent call last):
File "main.py", line 158, in
graphs_pattern, graphs_others, nums_nodes)
File "/home/cv/miniconda3/envs/Zmd/lib/python3.6/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/cv/ZMD/Pref-FEND-main/model/PrefFEND.py", line 100, in forward
idxs, dataset, tokens_features, map_for_fact_detector=map_entity, map_for_pattern_detector=map_pattern, fcs=self.fcs)
File "/home/cv/ZMD/Pref-FEND-main/model/PrefFEND.py", line 62, in forward_PreferencedDetector
idxs, dataset, tokens_features, map_for_pattern_detector)
File "/home/cv/miniconda3/envs/Zmd/lib/python3.6/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/cv/ZMD/Pref-FEND-main/model/PatternBasedModels.py", line 131, in forward
out = self.forward_BERT(idxs, dataset, nodes_tokens, maps=tokened_maps)
File "/home/cv/ZMD/Pref-FEND-main/model/PatternBasedModels.py", line 144, in forward_BERT
seq_output, _ = self.bert(input_ids)
File "/home/cv/miniconda3/envs/Zmd/lib/python3.6/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/cv/miniconda3/envs/Zmd/lib/python3.6/site-packages/transformers/modeling_bert.py", line 837, in forward
return_dict=return_dict,
File "/home/cv/miniconda3/envs/Zmd/lib/python3.6/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/cv/miniconda3/envs/Zmd/lib/python3.6/site-packages/transformers/modeling_bert.py", line 492, in forward
output_attentions,
File "/home/cv/miniconda3/envs/Zmd/lib/python3.6/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/cv/miniconda3/envs/Zmd/lib/python3.6/site-packages/transformers/modeling_bert.py", line 412, in forward
output_attentions=output_attentions,
File "/home/cv/miniconda3/envs/Zmd/lib/python3.6/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/cv/miniconda3/envs/Zmd/lib/python3.6/site-packages/transformers/modeling_bert.py", line 349, in forward
output_attentions,
File "/home/cv/miniconda3/envs/Zmd/lib/python3.6/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/cv/miniconda3/envs/Zmd/lib/python3.6/site-packages/transformers/modeling_bert.py", line 250, in forward
mixed_query_layer = self.query(hidden_states)
File "/home/cv/miniconda3/envs/Zmd/lib/python3.6/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/cv/miniconda3/envs/Zmd/lib/python3.6/site-packages/torch/nn/modules/linear.py", line 91, in forward
return F.linear(input, self.weight, self.bias)
File "/home/cv/miniconda3/envs/Zmd/lib/python3.6/site-packages/torch/nn/functional.py", line 1676, in linear
output = input.matmul(weight.t())
RuntimeError: CUDA error: CUBLAS_STATUS_ALLOC_FAILED when calling cublasCreate(handle)

使用Twitter数据集时将bert-base-chinese替换为bert-base-cased后报错

Start training...


Start Training Epoch 0 : 2023-03-25 16:48:34
0%| | 0/2206 [00:01<?, ?it/s]
Traceback (most recent call last):
File "main.py", line 158, in
graphs_pattern, graphs_others, nums_nodes)
File "/home/cv/miniconda3/envs/Zmd/lib/python3.6/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/cv/ZMD/Pref-FEND-main/model/PrefFEND.py", line 100, in forward
idxs, dataset, tokens_features, map_for_fact_detector=map_entity, map_for_pattern_detector=map_pattern, fcs=self.fcs)
File "/home/cv/ZMD/Pref-FEND-main/model/PrefFEND.py", line 62, in forward_PreferencedDetector
idxs, dataset, tokens_features, map_for_pattern_detector)
File "/home/cv/miniconda3/envs/Zmd/lib/python3.6/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/cv/ZMD/Pref-FEND-main/model/PatternBasedModels.py", line 131, in forward
out = self.forward_BERT(idxs, dataset, nodes_tokens, maps=tokened_maps)
File "/home/cv/ZMD/Pref-FEND-main/model/PatternBasedModels.py", line 163, in forward_BERT
out = self.fc(output)
File "/home/cv/miniconda3/envs/Zmd/lib/python3.6/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/cv/miniconda3/envs/Zmd/lib/python3.6/site-packages/torch/nn/modules/linear.py", line 93, in forward
return F.linear(input, self.weight, self.bias)
File "/home/cv/miniconda3/envs/Zmd/lib/python3.6/site-packages/torch/nn/functional.py", line 1690, in linear
ret = torch.addmm(bias, input, weight.t())
RuntimeError: mat1 dim 1 must match mat2 dim 0

似乎是bert维度的问题,请问大佬要怎么设置呢

缺少文件

您好!python input_of_emotions.py --dataset 'Weibo' 时提示

No such file or directory: '../../resources/Chinese/大连
理工大学情感词汇本体库/preprocess/words2array.pkl'

BERT_Emo模型和其它fact-base模型组合时是否输入向量有问题

大佬你好!单独的BERT_Emo以及其他不含BERT_Emo的模型组合都可以正常运行,只有BERT_Emo和MAC或者EVIN等组合时会报错,感觉是bert输入问题
==================== Experimental Dataset: Weibo ====================

Start time: 2023-03-25 14:57:35
save path: ckpts/BERT_Emo+DeClarE

Loading model...

Traceback (most recent call last):
File "main.py", line 57, in
model = PrefFEND(args)
File "/home/cv/ZMD/Pref-FEND-main/model/PrefFEND.py", line 29, in init
'{}(args)'.format(args.pattern_based_model))
File "", line 1, in
File "/home/cv/ZMD/Pref-FEND-main/model/PatternBasedModels.py", line 52, in init
args.bert_pretrained_model, return_dict=False)
File "/home/cv/miniconda3/envs/Zmd/lib/python3.6/site-packages/transformers/modeling_utils.py", line 853, in from_pretrained
**kwargs,
File "/home/cv/miniconda3/envs/Zmd/lib/python3.6/site-packages/transformers/configuration_utils.py", line 312, in from_pretrained
config_dict, kwargs = cls.get_config_dict(pretrained_model_name_or_path, **kwargs)
File "/home/cv/miniconda3/envs/Zmd/lib/python3.6/site-packages/transformers/configuration_utils.py", line 335, in get_config_dict
if os.path.isdir(pretrained_model_name_or_path):
File "/home/cv/miniconda3/envs/Zmd/lib/python3.6/genericpath.py", line 42, in isdir
st = os.stat(s)
TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType

其他模型都能正常运行,只有运行BERTEMO+MAC时报错

==================== Experimental Dataset: Weibo ====================

Start time: 2023-03-20 22:48:13
save path: ckpts/BERT_Emo+DeClarE_with_Pref-FEND

Loading model...

Traceback (most recent call last):
File "main.py", line 57, in
model = PrefFEND(args)
File "/home/cv/ZMD/Pref-FEND-main/model/PrefFEND.py", line 29, in init
'{}(args)'.format(args.pattern_based_model))
File "", line 1, in
File "/home/cv/ZMD/Pref-FEND-main/model/PatternBasedModels.py", line 52, in init
args.bert_pretrained_model, return_dict=False)
File "/home/cv/miniconda3/envs/Zmd/lib/python3.6/site-packages/transformers/modeling_utils.py", line 853, in from_pretrained
**kwargs,
File "/home/cv/miniconda3/envs/Zmd/lib/python3.6/site-packages/transformers/configuration_utils.py", line 312, in from_pretrained
config_dict, kwargs = cls.get_config_dict(pretrained_model_name_or_path, **kwargs)
File "/home/cv/miniconda3/envs/Zmd/lib/python3.6/site-packages/transformers/configuration_utils.py", line 335, in get_config_dict
if os.path.isdir(pretrained_model_name_or_path):
File "/home/cv/miniconda3/envs/Zmd/lib/python3.6/genericpath.py", line 42, in isdir
st = os.stat(s)
TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.