示例#1
0
    def run(self, datapath, pipetype):
        print('Loading training data from {0}...'.format(datapath))
        with open(datapath, 'r') as f:
            training_data = json.load(f)
            docs = ['{0} {1}'.format(d['title'], d['text']) for d in training_data]

        # These train to the PIPELINE_PATH specified in argos.conf.app
        if pipetype == 'bow':
            vector.train(docs)

        if pipetype in ['stanford', 'spotlight', 'keyword']:
            concept.train(docs, pipetype=pipetype)
示例#2
0
文件: run.py 项目: frnsys/galaxy
def train(pipetype, datapath):
    """
    Train the feature pipelines.
    """
    with open(datapath, 'r') as f:
        training_data = json.load(f)
        docs = ['{0} {1}'.format(d['title'], d['text']) for d in training_data]

    if pipetype == 'bow':
        vector.train(docs)

    if pipetype in ['stanford', 'spotlight', 'keyword']:
        concept.train(docs, pipetype=pipetype)
示例#3
0
def train(pipetype, datapath):
    """
    Train the feature pipelines.
    """
    with open(datapath, 'r') as f:
        training_data = json.load(f)
        docs = ['{0} {1}'.format(d['title'], d['text']) for d in training_data]

    if pipetype == 'bow':
        vector.train(docs)

    if pipetype in ['stanford', 'spotlight', 'keyword']:
        concept.train(docs, pipetype=pipetype)
示例#4
0
    def run(self, datapath, pipetype):
        print('Loading training data from {0}...'.format(datapath))
        with open(datapath, 'r') as f:
            training_data = json.load(f)
            docs = [
                '{0} {1}'.format(d['title'], d['text']) for d in training_data
            ]

        # These train to the PIPELINE_PATH specified in argos.conf.app
        if pipetype == 'bow':
            vector.train(docs)

        if pipetype in ['stanford', 'spotlight', 'keyword']:
            concept.train(docs, pipetype=pipetype)