mirror of
https://gitee.com/dromara/easyAi.git
synced 2024-12-02 03:38:08 +08:00
修改语句补全
This commit is contained in:
parent
01d624e1c2
commit
f22acce4b2
@ -15,7 +15,6 @@ public class SentenceCreator {//语言生成器
|
||||
private List<String> wordList = new ArrayList<>();//模型
|
||||
private NerveManager nerveManager;//模型
|
||||
private int maxWordNumber;
|
||||
private WordTemple wordTemple;
|
||||
|
||||
public SentenceCreator(WordTemple wordTemple, CreatorSentenceModel creatorSentenceModel) throws Exception {
|
||||
List<String> modelList = creatorSentenceModel.getWordList();
|
||||
@ -27,12 +26,10 @@ public class SentenceCreator {//语言生成器
|
||||
, 1, new Tanh(), false, wordTemple.getStudyPoint(), RZ.NOT_RZ, 0);
|
||||
nerveManager.init(true, false, wordTemple.isShowLog(), true, 0, 0);
|
||||
maxWordNumber = wordTemple.getMaxWordNumber();
|
||||
this.wordTemple = wordTemple;
|
||||
nerveManager.insertModelParameter(creatorSentenceModel.getModelParameter());
|
||||
}
|
||||
|
||||
public SentenceCreator(List<String> sentenceList, WordTemple wordTemple) throws Exception {
|
||||
this.wordTemple = wordTemple;
|
||||
this.sentenceList = anySort(sentenceList);
|
||||
int size = this.sentenceList.size();
|
||||
maxWordNumber = wordTemple.getMaxWordNumber();
|
||||
@ -77,8 +74,7 @@ public class SentenceCreator {//语言生成器
|
||||
}
|
||||
}
|
||||
|
||||
public String fill(String sentence) throws Exception {
|
||||
Talk talk = new Talk(wordTemple);
|
||||
public String fill(String sentence, Talk talk) throws Exception {
|
||||
int splitSize = talk.getSplitWord(sentence).size();//切词数量
|
||||
boolean isFill = splitSize < 5 && sentence.length() < 15;
|
||||
String upWord = null;
|
||||
|
Loading…
Reference in New Issue
Block a user