Comments (3)
可否将elmo.py里修改后的代码贴一下,还有报的错
from sifrank_zh.
可否将elmo.py里修改后的代码贴一下,还有报的错
Traceback (most recent call last):
File "D:/大论文/类似项目代码参考/SIFRank/test/test.py", line 21, in
keyphrases = SIFRank(text, SIF, zh_model, N=15,elmo_layers_weight=elmo_layers_weight)
File "D:\大论文\类似项目代码参考\SIFRank\model\method.py", line 180, in SIFRank
sent_embeddings, candidate_embeddings_list = SIF.get_tokenized_sent_embeddings(text_obj,if_DS=if_DS,if_EA=if_EA)
File "D:\大论文\类似项目代码参考\SIFRank\embeddings\sent_emb_sif.py", line 48, in get_tokenized_sent_embeddings
elmo_embeddings = self.word_embeddor.get_tokenized_words_embeddings(tokens_segmented)
File "D:\大论文\类似项目代码参考\SIFRank\embeddings\word_emb_elmo.py", line 29, in get_tokenized_words_embeddings
elmo_embedding = [np.pad(emb, pad_width=((0,0),(0,max_len-emb.shape[1]),(0,0)) , mode='constant') for emb in elmo_embedding]
File "D:\大论文\类似项目代码参考\SIFRank\embeddings\word_emb_elmo.py", line 29, in
elmo_embedding = [np.pad(emb, pad_width=((0,0),(0,max_len-emb.shape[1]),(0,0)) , mode='constant') for emb in elmo_embedding]
File "<array_function internals>", line 6, in pad
File "F:\Anaconda3\envs\keyword_extraction\lib\site-packages\numpy\lib\arraypad.py", line 741, in pad
pad_width = _as_pairs(pad_width, array.ndim, as_index=True)
File "F:\Anaconda3\envs\keyword_extraction\lib\site-packages\numpy\lib\arraypad.py", line 512, in _as_pairs
raise ValueError("index can't contain negative values")
ValueError: index can't contain negative values
这是报错。我在项目文件夹里找到了三个elmo.py文件,而且内容也是不需要修改的,很奇怪,不知道是不是我运行方法有误
from sifrank_zh.
elmo.py 应该是在 Python36\Lib\site-packages\elmoformanylangs\elmo.py 这个文件下,你找找看
from sifrank_zh.
Related Issues (20)
- 请问词性标注用的什么工具 啊?名词性短语,如何考虑虚词的呢? HOT 9
- 代码报错-- HOT 1
- 请问 dict.txt 是通过什么语料得到的呢? HOT 2
- 代码运行没报错,但是没有输出结果,是什么原因呢 HOT 3
- 运行test.py时报错: size mismatch for word_emb_layer.embedding.weight HOT 6
- 按照正常操作,没办法正常运行,是环境导致的吗? HOT 7
- import jieba.analyse HOT 1
- index can't contain negative values HOT 5
- 模型下载失败 HOT 7
- 提取的关键词倾向于带英文字母 HOT 4
- 处理数据 HOT 1
- 无法运行。。。ValueError: index can't contain negative values HOT 5
- 可视化 HOT 2
- model/input_representation.py 下stanfordcorenlp模块未注释 HOT 1
- encoder.pkl和token_embedder.pkl怎么添加 HOT 1
- ValueError: operands could not be broadcast together with remapped shapes [original->remapped]: (3,2) and requested shape (2,2) HOT 3
- 批量处理句子 HOT 3
- test.py文件执行报错 HOT 1
- 为什么pip install overrides==3.1.0 仍然提示Highway.forward: `input` must be present HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sifrank_zh.