Commit b96dbe0f authored by LiniEisha's avatar LiniEisha

Integrate

parent 99a8496c
......@@ -2,7 +2,7 @@ import nltk
import os
from fpdf import FPDF
def LectureNotice(notice_name):
def GetLectureNotice(notice_name):
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
FILE_PATH = os.path.join(BASE_DIR, "speechToText\\{}".format(notice_name))
......@@ -57,4 +57,6 @@ def LectureNotice(notice_name):
# save the pdf with name .pdf
pdf.output("PDF_DESTINATION_DIR")
return text
\ No newline at end of file
listToStr = ' '.join([str(elem) for elem in sentences_with_word])
return text, listToStr
\ No newline at end of file
......@@ -8,6 +8,7 @@ def LectureSummary(summary_name):
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
FILE_PATH = os.path.join(BASE_DIR, "speechToText\\{}".format(summary_name))
print('file path: ' , FILE_PATH)
DESTINATION_DIR = os.path.join(BASE_DIR, "summary\\Summary_{}".format(summary_name))
print('destination directory: ', DESTINATION_DIR)
......
......@@ -14,6 +14,7 @@ import datetime
# APIs used in Lecture Summarizing Component
from .ExtractKeySentences import GetLectureNotice
from .Summary import LectureSummary
from .noise import noise_removal
from .speech_to_text import speech_to_text
......@@ -106,7 +107,7 @@ class audioToTextList(APIView):
# generate new id for speech to text file
new_speech_to_text_id = generate_new_id(audio_to_text_list.lecture_speech_to_text_id)
new_speech_to_text_id = "LST0001" if audio_to_text_list is None else generate_new_id(audio_to_text_list.lecture_speech_to_text_id)
speech_to_text(speech_to_text_name)
......@@ -180,11 +181,11 @@ class LectureNoticeList(APIView):
# generate new id for notice
notice_id = "LN0001" if lecture_notice_list is None else generate_new_id(lecture_notice_list.lecture_notice_id)
text = LectureNotices(lecture_notice_name)
text, sentences_with_word = GetLectureNotice(lecture_notice_name)
LectureNotices(
lecture_notice_id=notice_id,
lecture_audio_id=id,
lecture_audio_id_id=id,
notice_text=text
).save()
return Response({"response": request.data})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment