gaur3009 commited on
Commit
90697ac
·
verified ·
1 Parent(s): 09f752a

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +7 -6
index.html CHANGED
@@ -100,12 +100,12 @@
100
  resultBox.style.display = "block";
101
 
102
  try {
103
- const response = await fetch("https://gaur3009-speech-grammar.hf.space/run/predict", {
104
  method: "POST",
105
- headers: { "Content-Type": "application/json" },
106
- body: JSON.stringify({
107
- data: [null, inputText],
108
- fn_index: 2
109
  })
110
  });
111
 
@@ -118,7 +118,8 @@
118
  const confidence = data?.data?.[1];
119
 
120
  if (prediction !== undefined) {
121
- resultText.innerText = `✅ Corrected: ${prediction}\n🔍 Confidence: ${confidence}%`;
 
122
  } else {
123
  resultText.innerText = "⚠️ Unexpected API response format.";
124
  }
 
100
  resultBox.style.display = "block";
101
 
102
  try {
103
+ const response = await fetch("https://gaur3009-gr-speech.hf.space/api/predict", {
104
  method: "POST",
105
+ headers: { "Content-Type": "application/json" },
106
+ body: JSON.stringify({
107
+ data: [document.getElementById("speechInput").value.trim()],
108
+ fn_index: 0
109
  })
110
  });
111
 
 
118
  const confidence = data?.data?.[1];
119
 
120
  if (prediction !== undefined) {
121
+ const [corrected, score] = data.data;
122
+ resultText.innerText = `✅ Corrected: ${corrected}\n🔍 Score: ${score}%`;
123
  } else {
124
  resultText.innerText = "⚠️ Unexpected API response format.";
125
  }