|
|
|
@ -1,6 +1,11 @@
|
|
|
|
|
package com.ruoyi.system.domain;
|
|
|
|
|
|
|
|
|
|
import com.ruoyi.common.constant.TrainingScoreConstants;
|
|
|
|
|
|
|
|
|
|
import java.lang.reflect.Method;
|
|
|
|
|
import java.text.DecimalFormat;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
public class SysTrainingScore {
|
|
|
|
|
/**
|
|
|
|
@ -2444,4 +2449,257 @@ public class SysTrainingScore {
|
|
|
|
|
public void setReportContent(String reportContent) {
|
|
|
|
|
this.reportContent = reportContent == null ? null : reportContent.trim();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void set(String methodName, Object value) {
|
|
|
|
|
try {
|
|
|
|
|
Method method = getClass().getMethod("set" + Character.toUpperCase(methodName.charAt(0)) + methodName.substring(1),value.getClass());
|
|
|
|
|
method.invoke(this, value);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Object get(String methodName) {
|
|
|
|
|
Object result = null;
|
|
|
|
|
try {
|
|
|
|
|
Method method = getClass().getMethod("get" + Character.toUpperCase(methodName.charAt(0)) + methodName.substring(1));
|
|
|
|
|
result = method.invoke(this);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void calculateDataScore() {
|
|
|
|
|
Date date = new Date();
|
|
|
|
|
dataCollectionScore=0;
|
|
|
|
|
textSegmentationScore=0;
|
|
|
|
|
partofspeechTaggingScore=0;
|
|
|
|
|
categoryManagementScore=0;
|
|
|
|
|
textClassificationScore=0;
|
|
|
|
|
textSummarizationScore=0;
|
|
|
|
|
similarityCalculationScore=0;
|
|
|
|
|
sentimentAnalysisScore=0;
|
|
|
|
|
dataVisualizationScore=0;
|
|
|
|
|
reportSubmissionScore=0;
|
|
|
|
|
DecimalFormat df = new DecimalFormat("0.00");
|
|
|
|
|
Map<String, Integer> trainingScoreConstantsMap = TrainingScoreConstants.getTrainingScoreConstantsMap();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int flag=0;
|
|
|
|
|
if (dataCollectionStepDescription != null && !"null".equals(dataCollectionStepDescription)) {
|
|
|
|
|
dataCollectionScore += trainingScoreConstantsMap.get("dataCollectionStepDescription");
|
|
|
|
|
flag++;
|
|
|
|
|
}
|
|
|
|
|
if (dataCollectionToolbarButton != null && !"null".equals(dataCollectionToolbarButton)) {
|
|
|
|
|
dataCollectionScore += trainingScoreConstantsMap.get("dataCollectionToolbarButton");
|
|
|
|
|
flag++;
|
|
|
|
|
}
|
|
|
|
|
if(flag!=0){
|
|
|
|
|
double result = (double) flag / 2 * 100;
|
|
|
|
|
String formattedResult = df.format(result);
|
|
|
|
|
dataCollectionProgress=formattedResult;
|
|
|
|
|
dataCollectionTime=date;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
flag=0;
|
|
|
|
|
if (textSegmentationStepDescription != null && !"null".equals(textSegmentationStepDescription)) {
|
|
|
|
|
textSegmentationScore += trainingScoreConstantsMap.get("textSegmentationStepDescription");
|
|
|
|
|
flag++;
|
|
|
|
|
}
|
|
|
|
|
if (textSegmentationToolbarButton != null && !"null".equals(textSegmentationToolbarButton)) {
|
|
|
|
|
textSegmentationScore += trainingScoreConstantsMap.get("textSegmentationToolbarButton");
|
|
|
|
|
flag++;
|
|
|
|
|
}
|
|
|
|
|
if (textSegmentationAnalysisTrainButton != null && !"null".equals(textSegmentationAnalysisTrainButton)) {
|
|
|
|
|
textSegmentationScore += trainingScoreConstantsMap.get("textSegmentationAnalysisTrainButton");
|
|
|
|
|
flag++;
|
|
|
|
|
}
|
|
|
|
|
if(flag!=0){
|
|
|
|
|
double result = (double) flag / 3 * 100;
|
|
|
|
|
String formattedResult = df.format(result);
|
|
|
|
|
textSegmentationProgress=formattedResult;
|
|
|
|
|
textSegmentationTime=date;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
flag=0;
|
|
|
|
|
if ( partofspeechTaggingStepDescription!= null && !"null".equals(partofspeechTaggingStepDescription)) {
|
|
|
|
|
partofspeechTaggingScore += trainingScoreConstantsMap.get("partofspeechTaggingStepDescription");
|
|
|
|
|
flag++;
|
|
|
|
|
}
|
|
|
|
|
if (partofspeechTaggingToolbarButton!=null && !"null".equals(partofspeechTaggingToolbarButton)) {
|
|
|
|
|
partofspeechTaggingScore += trainingScoreConstantsMap.get("partofspeechTaggingToolbarButton");
|
|
|
|
|
flag++;
|
|
|
|
|
}
|
|
|
|
|
if (partofspeechTaggingAnalysisTrainButton!= null && !"null".equals(partofspeechTaggingAnalysisTrainButton)) {
|
|
|
|
|
partofspeechTaggingScore += trainingScoreConstantsMap.get("partofspeechTaggingAnalysisTrainButton");
|
|
|
|
|
flag++;
|
|
|
|
|
}
|
|
|
|
|
if(flag!=0){
|
|
|
|
|
double result = (double) flag / 3 * 100;
|
|
|
|
|
String formattedResult = df.format(result);
|
|
|
|
|
partofspeechTaggingProgress=formattedResult;
|
|
|
|
|
partofspeechTaggingTime=date;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
flag=0;
|
|
|
|
|
if (categoryManagementStepDescription!= null && !"null".equals(categoryManagementStepDescription)) {
|
|
|
|
|
categoryManagementScore += trainingScoreConstantsMap.get("categoryManagementStepDescription");
|
|
|
|
|
flag++;
|
|
|
|
|
}
|
|
|
|
|
if (categoryManagementAddButton != null && !"null".equals(categoryManagementAddButton)) {
|
|
|
|
|
categoryManagementScore += trainingScoreConstantsMap.get("categoryManagementAddButton");
|
|
|
|
|
flag++;
|
|
|
|
|
}
|
|
|
|
|
if(flag!=0){
|
|
|
|
|
double result = (double) flag / 2 * 100;
|
|
|
|
|
String formattedResult = df.format(result);
|
|
|
|
|
categoryManagementProgress=formattedResult;
|
|
|
|
|
categoryManagementTime=date;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
flag=0;
|
|
|
|
|
if (textClassificationStepDescription!= null && !"null".equals(textClassificationStepDescription)) {
|
|
|
|
|
textClassificationScore += trainingScoreConstantsMap.get("textClassificationStepDescription");
|
|
|
|
|
flag++;
|
|
|
|
|
}
|
|
|
|
|
if (textClassificationArticleClassificationButton!= null && !"null".equals(textClassificationArticleClassificationButton)) {
|
|
|
|
|
textClassificationScore += trainingScoreConstantsMap.get("textClassificationArticleClassificationButton");
|
|
|
|
|
flag++;
|
|
|
|
|
}
|
|
|
|
|
if (textClassificationCreateArticleButton!= null && !"null".equals(textClassificationCreateArticleButton)) {
|
|
|
|
|
textClassificationScore += trainingScoreConstantsMap.get("textClassificationCreateArticleButton");
|
|
|
|
|
flag++;
|
|
|
|
|
}
|
|
|
|
|
if (textClassificationToolbarDetailsButton!= null && !"null".equals(textClassificationToolbarDetailsButton)) {
|
|
|
|
|
textClassificationScore += trainingScoreConstantsMap.get("textClassificationToolbarDetailsButton");
|
|
|
|
|
flag++;
|
|
|
|
|
}
|
|
|
|
|
if(flag!=0){
|
|
|
|
|
double result = (double) flag / 4 * 100;
|
|
|
|
|
String formattedResult = df.format(result);
|
|
|
|
|
textClassificationProgress=formattedResult;
|
|
|
|
|
textClassificationTime=date;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
flag=0;
|
|
|
|
|
if (textSummarizationStepDescription!= null && !"null".equals(textSummarizationStepDescription)) {
|
|
|
|
|
textSummarizationScore += trainingScoreConstantsMap.get("textSummarizationStepDescription");
|
|
|
|
|
flag++;
|
|
|
|
|
}
|
|
|
|
|
if (textSummarizationArticleSummaryButton!= null && !"null".equals(textSummarizationArticleSummaryButton)) {
|
|
|
|
|
textSummarizationScore += trainingScoreConstantsMap.get("textSummarizationArticleSummaryButton");
|
|
|
|
|
flag++;
|
|
|
|
|
}
|
|
|
|
|
if (textSummarizationCreateArticleButton!= null && !"null".equals(textSummarizationCreateArticleButton)) {
|
|
|
|
|
textSummarizationScore += trainingScoreConstantsMap.get("textSummarizationCreateArticleButton");
|
|
|
|
|
flag++;
|
|
|
|
|
}
|
|
|
|
|
if (textSummarizationToolbarDetailsButton!= null && !"null".equals(textSummarizationToolbarDetailsButton)) {
|
|
|
|
|
textSummarizationScore += trainingScoreConstantsMap.get("textSummarizationToolbarDetailsButton");
|
|
|
|
|
flag++;
|
|
|
|
|
}
|
|
|
|
|
if(flag!=0){
|
|
|
|
|
double result = (double) flag / 4 * 100;
|
|
|
|
|
String formattedResult = df.format(result);
|
|
|
|
|
textSummarizationProgress=formattedResult;
|
|
|
|
|
textSummarizationTime=date;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
flag=0;
|
|
|
|
|
if (similarityCalculationStepDescription!= null && !"null".equals(similarityCalculationStepDescription)) {
|
|
|
|
|
similarityCalculationScore += trainingScoreConstantsMap.get("similarityCalculationStepDescription");
|
|
|
|
|
flag++;
|
|
|
|
|
}
|
|
|
|
|
if (similarityCalculationAddButtonTop!= null && !"null".equals(similarityCalculationAddButtonTop)) {
|
|
|
|
|
similarityCalculationScore += trainingScoreConstantsMap.get("similarityCalculationAddButtonTop");
|
|
|
|
|
flag++;
|
|
|
|
|
}
|
|
|
|
|
if (similarityCalculationAddButtonBottom!= null && !"null".equals(similarityCalculationAddButtonBottom)) {
|
|
|
|
|
similarityCalculationScore += trainingScoreConstantsMap.get("similarityCalculationAddButtonBottom");
|
|
|
|
|
flag++;
|
|
|
|
|
}
|
|
|
|
|
if (similarityCalculationCalculateSimilarityButton!= null && !"null".equals(similarityCalculationCalculateSimilarityButton)) {
|
|
|
|
|
similarityCalculationScore += trainingScoreConstantsMap.get("similarityCalculationCalculateSimilarityButton");
|
|
|
|
|
flag++;
|
|
|
|
|
}
|
|
|
|
|
if(flag!=0){
|
|
|
|
|
double result = (double) flag / 4 * 100;
|
|
|
|
|
String formattedResult = df.format(result);
|
|
|
|
|
similarityCalculationProgress=formattedResult;
|
|
|
|
|
similarityCalculationTime=date;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
flag=0;
|
|
|
|
|
if (sentimentAnalysisStepDescription!= null && !"null".equals(sentimentAnalysisStepDescription)) {
|
|
|
|
|
sentimentAnalysisScore += trainingScoreConstantsMap.get("sentimentAnalysisStepDescription");
|
|
|
|
|
flag++;
|
|
|
|
|
}
|
|
|
|
|
if (sentimentAnalysisSelectButton!= null && !"null".equals(sentimentAnalysisSelectButton)) {
|
|
|
|
|
sentimentAnalysisScore += trainingScoreConstantsMap.get("sentimentAnalysisSelectButton");
|
|
|
|
|
flag++;
|
|
|
|
|
}
|
|
|
|
|
if (sentimentAnalysisSentimentAnalysisButton!= null && !"null".equals(sentimentAnalysisSentimentAnalysisButton)) {
|
|
|
|
|
sentimentAnalysisScore += trainingScoreConstantsMap.get("sentimentAnalysisSentimentAnalysisButton");
|
|
|
|
|
flag++;
|
|
|
|
|
}
|
|
|
|
|
if (sentimentAnalysisCreateSentimentWordButton!= null && !"null".equals(sentimentAnalysisCreateSentimentWordButton)) {
|
|
|
|
|
sentimentAnalysisScore += trainingScoreConstantsMap.get("sentimentAnalysisCreateSentimentWordButton");
|
|
|
|
|
flag++;
|
|
|
|
|
}
|
|
|
|
|
if(flag!=0){
|
|
|
|
|
double result = (double) flag / 4 * 100;
|
|
|
|
|
String formattedResult = df.format(result);
|
|
|
|
|
sentimentAnalysisProgress=formattedResult;
|
|
|
|
|
sentimentAnalysisTime=date;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
flag=0;
|
|
|
|
|
if (dataVisualizationStepDescription!= null && !"null".equals(dataVisualizationStepDescription)) {
|
|
|
|
|
dataVisualizationScore += trainingScoreConstantsMap.get("dataVisualizationStepDescription");
|
|
|
|
|
flag++;
|
|
|
|
|
}
|
|
|
|
|
if (dataVisualizationWordCloudButton!= null && !"null".equals(dataVisualizationWordCloudButton)) {
|
|
|
|
|
dataVisualizationScore += trainingScoreConstantsMap.get("dataVisualizationWordCloudButton");
|
|
|
|
|
flag++;
|
|
|
|
|
}
|
|
|
|
|
if (dataVisualizationSocialNetworkAnalysisButton!= null && !"null".equals(dataVisualizationSocialNetworkAnalysisButton)) {
|
|
|
|
|
dataVisualizationScore += trainingScoreConstantsMap.get("dataVisualizationSocialNetworkAnalysisButton");
|
|
|
|
|
flag++;
|
|
|
|
|
}
|
|
|
|
|
if (dataVisualizationSentimentAnalysisButton!= null && !"null".equals(dataVisualizationSentimentAnalysisButton)) {
|
|
|
|
|
dataVisualizationScore += trainingScoreConstantsMap.get("dataVisualizationSentimentAnalysisButton");
|
|
|
|
|
flag++;
|
|
|
|
|
}
|
|
|
|
|
if(flag!=0){
|
|
|
|
|
double result = (double) flag / 4 * 100;
|
|
|
|
|
String formattedResult = df.format(result);
|
|
|
|
|
dataVisualizationProgress=formattedResult;
|
|
|
|
|
dataVisualizationTime=date;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
flag=0;
|
|
|
|
|
if (reportSubmissionExperiencePageSaveButton!= null && !"null".equals(reportSubmissionExperiencePageSaveButton)) {
|
|
|
|
|
reportSubmissionScore += trainingScoreConstantsMap.get("reportSubmissionExperiencePageSaveButton");
|
|
|
|
|
flag++;
|
|
|
|
|
}
|
|
|
|
|
if (reportSubmissionUploadReportButton!= null && !"null".equals(reportSubmissionUploadReportButton)) {
|
|
|
|
|
reportSubmissionScore += trainingScoreConstantsMap.get("reportSubmissionUploadReportButton");
|
|
|
|
|
flag++;
|
|
|
|
|
}
|
|
|
|
|
if (reportSubmissionSubmitButton!= null && !"null".equals(reportSubmissionSubmitButton)) {
|
|
|
|
|
reportSubmissionScore += trainingScoreConstantsMap.get("reportSubmissionSubmitButton");
|
|
|
|
|
flag++;
|
|
|
|
|
}
|
|
|
|
|
if(flag!=0){
|
|
|
|
|
double result = (double) flag / 3 * 100;
|
|
|
|
|
String formattedResult = df.format(result);
|
|
|
|
|
reportSubmissionProgress=formattedResult;
|
|
|
|
|
reportSubmissionTime=date;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
trainingOperationScore=dataCollectionScore+textSegmentationScore+partofspeechTaggingScore+categoryManagementScore+textClassificationScore
|
|
|
|
|
+textSummarizationScore+similarityCalculationScore+sentimentAnalysisScore+dataVisualizationScore+reportSubmissionScore;
|
|
|
|
|
}
|
|
|
|
|
}
|