package org.algorithm.test;

import org.algorithm.core.cnn.dataset.RelationExtractionDataSet;
import org.algorithm.core.cnn.entity.Lemma;
import org.algorithm.core.cnn.model.RelationExtractionModel;
import org.algorithm.core.cnn.entity.Triad;
import org.algorithm.core.cnn.model.impl.RelationExtractionModelImpl;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author: bijl
 * @Date: 2019/1/22 14:15
 * @Decription: 测试关系抽取模型
 */
public class RelationExtractionModelTest {

    public static void main(String[] args) {

        String sentence = "病来患者神清，精神软，食欲、睡眠差，小便如常，大便1/日，水样便，近半年体重无明显增减";
        RelationExtractionModel model = new RelationExtractionModelImpl();

        List<Lemma> lemmas = new ArrayList<>();
        Lemma lemma = new Lemma();
        lemma.setText("双手");
        lemma.setLen(2); // 双手
        lemma.setPosition("1,2");
        lemma.setProperty("1");
        lemmas.add(lemma);

        Lemma lemma1 = new Lemma();
        lemma1.setText("有");
        lemma1.setLen(1); // 双手
        lemma1.setPosition("0,0");
        lemma1.setProperty("3");
        lemmas.add(lemma1);

        Lemma lemma2 = new Lemma();
        lemma2.setText("麻木感");
        lemma2.setLen(3); // 双手
        lemma2.setPosition("3,5");
        lemma2.setProperty("5");
        lemmas.add(lemma2);


//        for (Triad triad: model.execute(sentence, lemmas)) {
//            System.out.println(triad.getL_1().getText() + "--->"
//                    + triad.getL_2().getText() + ":" + triad.getRelation());
//        }
    }
}
