Skip to content

Commit

Permalink
Merge pull request #976 from AI4Bharat/ocrsegcat1
Browse files Browse the repository at this point in the history
added input fields for language, ocr domain and prediction
  • Loading branch information
ishvindersethi22 authored Mar 20, 2024
2 parents 1bf2d7c + 3c25eef commit f68d496
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/ui/pages/component/common/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ console.log(unseenNotifications,'uuu');
};

return (
<Grid container direction="row" style={{ zIndex: 2 }}>
<Grid container direction="row" style={{ zIndex: 200 }}>
<Box
className={location.pathname.includes("AudioTranscriptionLandingPage") ? classes.AudioparentContainers
: classes.parentContainer
Expand Down
83 changes: 72 additions & 11 deletions src/ui/pages/container/Label-Studio/LSF.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1041,8 +1041,9 @@ export default function LSF() {
const reviewNotesRef = useRef(null);
const { taskId } = useParams();
const [taskData, setTaskData] = useState([]);
const [annotationtext, setannotationtext] = useState("");
const [reviewtext, setreviewtext] = useState("");
const [predictions, setPredictions] = useState([]);
const [annotationtext,setannotationtext] = useState('')
const [reviewtext,setreviewtext] = useState('')
const [showTagsInput, setShowTagsInput] = useState(false);
const [selectedTag, setSelectedTag] = useState("");
const [alertData, setAlertData] = useState({
Expand All @@ -1064,15 +1065,14 @@ export default function LSF() {
};

const formats = [
"size",
"bold",
"italic",
"underline",
"strike",
"color",
"background",
"script",
];
'size',
'bold','italic','underline','strike',
'color','background',
'script']

useEffect(() => {
setPredictions(taskData?.data?.ocr_prediction_json);
}, [taskData]);

const handleTagChange = (event, value, reason) => {
if (reason === "selectOption") {
Expand Down Expand Up @@ -1336,6 +1336,67 @@ export default function LSF() {
showLoader={showLoader}
hideLoader={hideLoader}
/>
{!loader &&
<>
<div style={{borderStyle:"solid", borderWidth:"1px", borderColor:"#E0E0E0", paddingBottom:"1%", display:"flex", justifyContent:"space-around"}}>
<div style={{paddingLeft:"1%", fontSize:"medium", paddingTop:"1%", display:"flex"}}><div style={{margin:"auto"}}>Languages :&nbsp;</div>
<select multiple>
<option value="en">English</option>
<option value="hi">Hindi</option>
<option value="mr">Marathi</option>
<option value="ta">Tamil</option>
<option value="te">Telugu</option>
<option value="kn">Kannada</option>
<option value="gu">Gujarati</option>
<option value="pa">Punjabi</option>
<option value="bn">Bengali</option>
<option value="ml">Malayalam</option>
<option value="as">Assamese</option>
<option value="brx">Bodo</option>
<option value="doi">Dogri</option>
<option value="ks">Kashmiri</option>
<option value="mai">Maithili</option>
<option value="mni">Manipuri</option>
<option value="ne">Nepali</option>
<option value="or">Odia</option>
<option value="sd">Sindhi</option>
<option value="si">Sinhala</option>
<option value="ur">Urdu</option>
<option value="sat">Santali</option>
<option value="sa">Sanskrit</option>
<option value="gom">Goan Konkani</option>
</select>
</div>
<div style={{paddingLeft:"1%", fontSize:"medium", paddingTop:"1%", display:"flex"}}><div style={{margin:"auto"}}>Domain :&nbsp;</div>
<select style={{margin:"auto"}}>
<option disabled selected></option>
<option value="BO">Books</option>
<option value="FO">Forms</option>
<option value="OT">Others</option>
<option value="TB">Textbooks</option>
<option value="NV">Novels</option>
<option value="NP">Newspapers</option>
<option value="MG">Magazines</option>
<option value="RP">Research_Papers</option>
<option value="FM">Form</option>
<option value="BR">Brochure_Posters_Leaflets</option>
<option value="AR">Acts_Rules</option>
<option value="PB">Publication</option>
<option value="NT">Notice</option>
<option value="SY">Syllabus</option>
<option value="QP">Question_Papers</option>
<option value="MN">Manual</option>
</select>
</div>
</div>
<div style={{borderStyle:"solid", borderWidth:"1px", borderColor:"#E0E0E0", paddingBottom:"1%"}}>
<div style={{paddingLeft:"1%", fontSize:"medium", paddingTop:"1%", paddingBottom:"1%"}}>Predictions</div>
{predictions?.map((pred, index) => (
<div style={{paddingLeft:"2%", display:"flex", paddingRight:"2%", paddingBottom:"1%"}}><div style={{padding:"1%", margin:"auto", color:"#9E9E9E"}}>{index}</div><textarea readOnly style={{width:"100%", borderColor:"#E0E0E0"}} value={pred.text}/></div>
))}
</div>
</>
}
</Card>
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion src/ui/pages/container/Label-Studio/labelConfigJSX.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const labelConfigJS = `<View>
<Image name="image_url" value="$image_url"/>
<Image name="image_url" value="$image_url" maxWidth="900px"/>
<Filter name="filter" toName="annotation_labels"
hotkey="shift+f" minlength="0"
placeholder="Filter Labels" />
Expand Down

0 comments on commit f68d496

Please sign in to comment.