词性标注修改

master
yz
parent 5b1948c1c9
commit b8e3d55a57

@ -128,6 +128,43 @@ public class DocInfoController extends BaseController {
return AjaxResult.success("查询成功",result);
}
@PostMapping("/getInfoDelHtmlByContent")
public AjaxResult getInfoDelHtmlByContent(@RequestBody String content) throws IOException {
JSONObject result = new JSONObject();
content = MyObjects.delHTMLTag(content);
content = MyObjects.delSpace(content);
JSONArray labels = new JSONArray();
result.put("content",content);
result.put("connections",new JSONArray());
result.put("connectionCategories",MyObjects.connectionCategories);
result.put("labelCategories",MyObjects.labelCategories);
Sentence sentence = DependencyParserUtils.nerAnalysis(content);
List<IWord> wordList = sentence.wordList;
if(wordList!=null&&wordList.size()>0){
int offset = 0;
int id = 0;
for(int i=0;i<wordList.size();i++){
String value = wordList.get(i).getValue();
String label = wordList.get(i).getLabel();
if(MyObjects.wordsMapping.get(label)!=null){
Integer startIndex = offset;
Integer endIndex = offset+value.length();
Integer categoryId = MyObjects.wordsMapping.get(label);
JSONObject jsonObject = new JSONObject();
jsonObject.put("id",id);
jsonObject.put("categoryId",categoryId);
jsonObject.put("startIndex",startIndex);
jsonObject.put("endIndex",endIndex);
labels.add(jsonObject);
}
offset += value.length();
id++;
}
result.put("labels",labels);
}
return AjaxResult.success("查询成功",result);
}
@PostMapping("/uploadPosTag")
public AjaxResult uploadPosTag(@RequestBody JSONObject jsonObject) throws IOException {
System.out.println(jsonObject);

Loading…
Cancel
Save