Giter VIP home page Giter VIP logo

Comments (9)

sunyilgdx avatar sunyilgdx commented on June 6, 2024

不清楚你有没有修改哈工大ELMo里的bug,#31

from sifrank_zh.

RFHzhj avatar RFHzhj commented on June 6, 2024

已经按照您readme里面写的修改啦

from sifrank_zh.

RFHzhj avatar RFHzhj commented on June 6, 2024

还麻烦问下,为啥下载了thulac以后没有thulac.models文件

from sifrank_zh.

RFHzhj avatar RFHzhj commented on June 6, 2024

谢谢,问题已经解决了。求问有什么方法能提高推理速度吗

from sifrank_zh.

sunyilgdx avatar sunyilgdx commented on June 6, 2024

实际情况下可以提前计算单词的静态ELMo词向量,做成索引,可以大大加快速度 @RFHzhj

from sifrank_zh.

RFHzhj avatar RFHzhj commented on June 6, 2024

实际情况下可以提前计算单词的静态ELMo词向量,做成索引,可以大大加快速度 @RFHzhj

谢谢大佬

from sifrank_zh.

zhangdeshan avatar zhangdeshan commented on June 6, 2024

实际情况下可以提前计算单词的静态ELMo词向量,做成索引,可以大大加快速度 @RFHzhj

谢谢大佬

谢谢,问题已经解决了。求问有什么方法能提高推理速度吗

我现在也遇到了这个问题,怎么解决的?能说说么?感谢

from sifrank_zh.

sunyilgdx avatar sunyilgdx commented on June 6, 2024

项目里面用文本分割切片和向量对齐的方法提高单个出入的推理速度,但还是绕不过用ELMo进行编码计算,可有以下几个方案:
1.实际情况下可以提前建立类似GloVe的“词-词向量”对应表,这样的速度已经比较快了,但是会存在OOV的问题;这个我在做数据集中的测试时用的这种方法,只要是单词表不变,就不会对结果有太大的影响
2.可以尝试停用LSTM层,只用char-Embedding层,效果也还可以
3.LSTM替换成transformer,AllenNLP官网是有英文模型的,这个我在实验中试过,速度提升了,但是效果变差

from sifrank_zh.

Sundyo avatar Sundyo commented on June 6, 2024

Traceback (most recent call last):
File "D:/algo/SIFRank_zh-master/embeddings/word_emb_elmo.py", line 38, in
embs = elmo.get_tokenized_words_embeddings(sents)
File "D:/algo/SIFRank_zh-master/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:/algo/SIFRank_zh-master/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 "D:\Anaconda\envs\baidu\lib\site-packages\numpy\lib\arraypad.py", line 748, in pad
pad_width = _as_pairs(pad_width, array.ndim, as_index=True)
File "D:\Anaconda\envs\baidu\lib\site-packages\numpy\lib\arraypad.py", line 519, in _as_pairs
raise ValueError("index can't contain negative values")
ValueError: index can't contain negative values

求问大佬,这个报错是什么原因啊?

请问您是怎么解决这个报错的呀!?急,求解答!谢谢啦!

from sifrank_zh.

Related Issues (20)

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.