Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: change the confidence value format to percentage #461

Merged
8 changes: 2 additions & 6 deletions src/react/components/pages/predict/predictModelInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,16 @@ import React from 'react'
import './predictModelInfo.scss';

export default function PredictModelInfo({ modelInfo }) {
const { docType, modelId, docTypeConfidence } = modelInfo;
const { modelId, docTypeConfidence } = modelInfo;
return (
<div className="model-info-container">
<div className="model-info-item">
<span className="title" >docType:</span>
<span className="value" >{docType}</span>
</div>
<div className="model-info-item">
<span className="title" >modelId:</span>
<span className="value" >{modelId}</span>
</div>
<div className="model-info-item">
<span className="title" >docTypeConfidence:</span>
<span className="value" >{docTypeConfidence}</span>
<span className="value" >{(docTypeConfidence * 100).toFixed(2) + "%"}</span>
</div>
</div>
)
Expand Down
2 changes: 1 addition & 1 deletion src/react/components/pages/predict/predictResult.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export default class PredictResult extends React.Component<IPredictResultProps,
}
</div>
<div className={"predictiontag-confidence"}>
<span>{item.confidence}</span>
<span>{(item.confidence * 100).toFixed(2)+"%" }</span>
</div>
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion src/react/components/pages/train/trainRecord.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default class TrainRecord extends React.Component<ITrainRecordProps, ITra
</p>
<h6>Average accuracy:</h6>
<p>
{this.props.averageAccuracy}
{(this.props.averageAccuracy * 100).toFixed(2)+"%"}
</p>
<div className="accuracy-info">
<a href="https://aka.ms/form-recognizer/docs/train" target="_blank" rel="noopener noreferrer">
Expand Down
2 changes: 1 addition & 1 deletion src/react/components/pages/train/trainTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default class TrainTable
Object.entries(this.props.accuracies).map((entry) =>
<tr key={entry[0]}>
<td>{entry[0]}</td>
<td className="text-right">{entry[1]}</td>
<td className="text-right">{(entry[1] * 100).toFixed(2) + "%"}</td>
</tr>)
}
</tbody>
Expand Down