GithubHelp home page GithubHelp logo

Comments (5)

hailiang-wang avatar hailiang-wang commented on July 16, 2024

参考 https://github.com/Samurais/insuranceqa-corpus-zh/blob/release/deep_qa_1/network.py#L142

from insuranceqa-corpus-zh.

hailiang-wang avatar hailiang-wang commented on July 16, 2024

例如:

    def predict(self, text, seg = True):
        '''
        predict a text
        '''
        v = corpus.v(text, seg = seg)
        if len(v) > 0:
            return np.argmax(self.feedforward(np.reshape(v, (self.input_layer_size, 1))))
        else:
            return 1

就是将输入的query转化成向量,再做前向网络的计算。

from insuranceqa-corpus-zh.

dengqiqi123 avatar dengqiqi123 commented on July 16, 2024

不明白是怎么做问答输出的?predict预测出来是0 和 1

from insuranceqa-corpus-zh.

MrRace avatar MrRace commented on July 16, 2024

例如:

    def predict(self, text, seg = True):
        '''
        predict a text
        '''
        v = corpus.v(text, seg = seg)
        if len(v) > 0:
            return np.argmax(self.feedforward(np.reshape(v, (self.input_layer_size, 1))))
        else:
            return 1

就是将输入的query转化成向量,再做前向网络的计算。

这里的text是指原始的问句吧,然后你这里仅仅示意分词和矢量化。请问对于一个新输入的问句此时构建input也是需要添加<GO>吗?或者是直接只要PAD就可以?

from insuranceqa-corpus-zh.

Sunwc0 avatar Sunwc0 commented on July 16, 2024

这就是个文本分类的网络把,输出救俩类

from insuranceqa-corpus-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.