Skip to content

Commit

Permalink
refactor: change the confidence value format to percentage (#461)
Browse files Browse the repository at this point in the history
* update the confidence formate to percentage

* remove docType from predicatModelInfo

Co-authored-by: alex-krasn <64093224+alex-krasn@users.noreply.github.com>
Co-authored-by: kunzheng <58841788+kunzms@users.noreply.github.com>
  • Loading branch information
3 people authored Sep 27, 2020
1 parent 7a3f7a7 commit e806b4e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
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

0 comments on commit e806b4e

Please sign in to comment.