Update student_functions.py
Browse files- student_functions.py +1 -12
student_functions.py
CHANGED
@@ -5,7 +5,6 @@ from selenium.webdriver.common.by import By
|
|
5 |
from selenium.webdriver.common.keys import Keys
|
6 |
from selenium.webdriver.support.ui import WebDriverWait
|
7 |
from selenium.webdriver.support import expected_conditions as EC
|
8 |
-
import easyocr
|
9 |
import json
|
10 |
from youtube_transcript_api import YouTubeTranscriptApi
|
11 |
from youtube_transcript_api.formatters import JSONFormatter
|
@@ -66,17 +65,7 @@ Answer: [Option number]'''},
|
|
66 |
print("Quiz generated")
|
67 |
return quiz_output
|
68 |
|
69 |
-
|
70 |
-
reader = easyocr.Reader(['en'])
|
71 |
-
try:
|
72 |
-
result = reader.readtext(image_path)
|
73 |
-
extracted_text = ''
|
74 |
-
for (bbox, text, prob) in result:
|
75 |
-
extracted_text += text + ' '
|
76 |
-
return extracted_text.strip()
|
77 |
-
except Exception as e:
|
78 |
-
print(f"Error during OCR: {e}")
|
79 |
-
return ''
|
80 |
|
81 |
def generate_ai_response(query):
|
82 |
ai_response = ''
|
|
|
5 |
from selenium.webdriver.common.keys import Keys
|
6 |
from selenium.webdriver.support.ui import WebDriverWait
|
7 |
from selenium.webdriver.support import expected_conditions as EC
|
|
|
8 |
import json
|
9 |
from youtube_transcript_api import YouTubeTranscriptApi
|
10 |
from youtube_transcript_api.formatters import JSONFormatter
|
|
|
65 |
print("Quiz generated")
|
66 |
return quiz_output
|
67 |
|
68 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
|
70 |
def generate_ai_response(query):
|
71 |
ai_response = ''
|