词性标注新增柱状图参数

master
yz 2 years ago
parent b8e3d55a57
commit 737146b3c4

@ -103,6 +103,13 @@ public class DocInfoController extends BaseController {
result.put("labelCategories",MyObjects.labelCategories);
Sentence sentence = DependencyParserUtils.nerAnalysis(content);
List<IWord> wordList = sentence.wordList;
int noun=0;
int personalName=0;
int placeName=0;
int InstitutionalGroup=0;
int verb=0;
int adjective=0;
int adverb=0;
if(wordList!=null&&wordList.size()>0){
int offset = 0;
int id = 0;
@ -115,6 +122,21 @@ public class DocInfoController extends BaseController {
Integer categoryId = MyObjects.wordsMapping.get(label);
JSONObject jsonObject = new JSONObject();
jsonObject.put("id",id);
if(categoryId==0){
noun++;
}else if(categoryId==1){
personalName++;
}else if(categoryId==2){
placeName++;
}else if(categoryId==3){
InstitutionalGroup++;
}else if(categoryId==4){
verb++;
}else if(categoryId==5){
adjective++;
}else if(categoryId==6){
adverb++;
}
jsonObject.put("categoryId",categoryId);
jsonObject.put("startIndex",startIndex);
jsonObject.put("endIndex",endIndex);
@ -125,6 +147,13 @@ public class DocInfoController extends BaseController {
}
result.put("labels",labels);
}
result.put("noun",noun);
result.put("personalName",personalName);
result.put("placeName",placeName);
result.put("institutionalGroup",InstitutionalGroup);
result.put("verb",verb);
result.put("adjective",adjective);
result.put("adverb",adverb);
return AjaxResult.success("查询成功",result);
}

@ -63,7 +63,8 @@ public class CategoryService extends EsService<Category> {
if(id==null||id.trim().length()==0){
return null;
}
List<Category> categories = esLambdaQuery().eq(Category::getId,id).query();
// List<Category> categories = esLambdaQuery().eq(Category::getId,id).query();
List<Category> categories = esLambdaQuery().getDoc_InfoBy_Id(Category::getId,id).query();
return categories!=null&&categories.size()>0?categories.get(0):null;
}

Loading…
Cancel
Save