Skip to content

Commit

Permalink
Merge pull request #709 from AI4Bharat/acoustic
Browse files Browse the repository at this point in the history
empty acoustic_text validation
  • Loading branch information
aparna-aa authored Sep 13, 2023
2 parents 3a2a80a + bfee12e commit fc0361f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ const AudioTranscriptionLandingPage = () => {
const [showStdTranscript, setShowStdTranscript] = useState(false);
const [stdTranscriptionSettings, setStdTranscriptionSettings] = useState({
enable: false,
showAcoustic: false,
rtl: false,
enableTransliteration: false,
enableTransliterationSuggestion: false,
Expand Down Expand Up @@ -243,7 +244,7 @@ const AudioTranscriptionLandingPage = () => {


useEffect(() => {
const hasEmptyText = result?.some((element) => element.text?.trim() === "");
const hasEmptyText = result?.some((element) => element.text?.trim() === "") || (stdTranscriptionSettings.showAcoustic && result?.some((element) => element.acoustic_normalised_text?.trim() === ""))
const hasEmptySpeaker = result?.some(
(element) => element.speaker_id?.trim() === ""
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ const ReviewAudioTranscriptionLandingPage = () => {
const [showStdTranscript, setShowStdTranscript] = useState(false);
const [stdTranscriptionSettings, setStdTranscriptionSettings] = useState({
enable: false,
showAcoustic: false,
rtl: false,
enableTransliteration: false,
enableTransliterationSuggestion: false,
Expand Down Expand Up @@ -257,7 +258,7 @@ const ReviewAudioTranscriptionLandingPage = () => {
}, [AnnotationsTaskDetails, user, taskDetailList]);

useEffect(() => {
const hasEmptyText = result?.some((element) => element.text?.trim() === "");
const hasEmptyText = result?.some((element) => element.text?.trim() === "") || (stdTranscriptionSettings.showAcoustic && result?.some((element) => element.acoustic_normalised_text?.trim() === ""))
const hasEmptySpeaker = result?.some(
(element) => element.speaker_id?.trim() === ""
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ const SuperCheckerAudioTranscriptionLandingPage = () => {
const [showStdTranscript, setShowStdTranscript] = useState(false);
const [stdTranscriptionSettings, setStdTranscriptionSettings] = useState({
enable: false,
showAcoustic: false,
rtl: false,
enableTransliteration: false,
enableTransliterationSuggestion: false,
Expand Down Expand Up @@ -176,7 +177,7 @@ const SuperCheckerAudioTranscriptionLandingPage = () => {


useEffect(() => {
const hasEmptyText = result?.some((element) => element.text?.trim() === "");
const hasEmptyText = result?.some((element) => element.text?.trim() === "") || (stdTranscriptionSettings.showAcoustic && result?.some((element) => element.acoustic_normalised_text?.trim() === ""))
const hasEmptySpeaker = result?.some(
(element) => element.speaker_id?.trim() === ""
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,12 @@ const TranscriptionRightPanel = ({
}
}, [currentIndex]);

//Uncomment this block to enable standardised_transcription in future
/* useEffect(() => {
useEffect(() => {
if(showAcousticText) {
handleStdTranscriptionSettings({
enable: true,
//set enable:true to enable standardised_transcription
enable: false,
showAcoustic: true,
rtl: enableRTL_Typing,
enableTransliteration: ProjectDetails?.tgt_language !== "en" && enableTransliteration,
enableTransliterationSuggestion,
Expand All @@ -192,7 +193,7 @@ const TranscriptionRightPanel = ({
});
}
}, [showAcousticText, ProjectDetails, enableRTL_Typing, enableTransliteration, enableTransliterationSuggestion, targetlang, fontSize]);
*/


const getPayload = (offset = currentOffset, lim = limit) => {
const payloadObj = new GetAnnotationsTaskAPI(
Expand Down

0 comments on commit fc0361f

Please sign in to comment.