Coder Social home page Coder Social logo

Comments (6)

92xianshen avatar 92xianshen commented on May 22, 2024

遇到了同样的问题~

from zhihu.

92xianshen avatar 92xianshen commented on May 22, 2024

还再纠结这个问题么?

from zhihu.

92xianshen avatar 92xianshen commented on May 22, 2024

@callwhl 问题解决了么?

from zhihu.

spiderHJS avatar spiderHJS commented on May 22, 2024

因为词汇表在训练的时候和预测时候使用的不是同一个,因为vocab是通过set建立的,set中的元素顺序不一样,所以在预测时候生成类似于乱码的文本。解决方法是,在训练的时候将得到的词汇表存储下来,在预测的时候使用训练时候的词汇表。

from zhihu.

am9x avatar am9x commented on May 22, 2024

在训练的时候将得到的词汇表存储下来,在预测的时候使用训练时候的词汇表。

注意:存的时候如果直接pkl.dump那个vocab set,继续会有同样问题
应该pkl.dump(list(vocab))

from zhihu.

RangHeng avatar RangHeng commented on May 22, 2024

请问怎么把训练和测试代码分开。我用的pycharm,不是ipython,.

from zhihu.

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.