Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2020-101
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Sachith Fernando
2020-101
Commits
b96dbe0f
Commit
b96dbe0f
authored
Jan 10, 2021
by
LiniEisha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Integrate
parent
99a8496c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
5 deletions
+9
-5
LectureSummarizingApp/ExtractKeySentences.py
LectureSummarizingApp/ExtractKeySentences.py
+4
-2
LectureSummarizingApp/Summary.py
LectureSummarizingApp/Summary.py
+1
-0
LectureSummarizingApp/api.py
LectureSummarizingApp/api.py
+4
-3
No files found.
LectureSummarizingApp/ExtractKeySentences.py
View file @
b96dbe0f
...
@@ -2,7 +2,7 @@ import nltk
...
@@ -2,7 +2,7 @@ import nltk
import
os
import
os
from
fpdf
import
FPDF
from
fpdf
import
FPDF
def
LectureNotice
(
notice_name
):
def
Get
LectureNotice
(
notice_name
):
BASE_DIR
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
BASE_DIR
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
FILE_PATH
=
os
.
path
.
join
(
BASE_DIR
,
"speechToText
\\
{}"
.
format
(
notice_name
))
FILE_PATH
=
os
.
path
.
join
(
BASE_DIR
,
"speechToText
\\
{}"
.
format
(
notice_name
))
...
@@ -57,4 +57,6 @@ def LectureNotice(notice_name):
...
@@ -57,4 +57,6 @@ def LectureNotice(notice_name):
# save the pdf with name .pdf
# save the pdf with name .pdf
pdf
.
output
(
"PDF_DESTINATION_DIR"
)
pdf
.
output
(
"PDF_DESTINATION_DIR"
)
return
text
listToStr
=
' '
.
join
([
str
(
elem
)
for
elem
in
sentences_with_word
])
\ No newline at end of file
return
text
,
listToStr
\ No newline at end of file
LectureSummarizingApp/Summary.py
View file @
b96dbe0f
...
@@ -8,6 +8,7 @@ def LectureSummary(summary_name):
...
@@ -8,6 +8,7 @@ def LectureSummary(summary_name):
BASE_DIR
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
BASE_DIR
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
FILE_PATH
=
os
.
path
.
join
(
BASE_DIR
,
"speechToText
\\
{}"
.
format
(
summary_name
))
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
))
DESTINATION_DIR
=
os
.
path
.
join
(
BASE_DIR
,
"summary
\\
Summary_{}"
.
format
(
summary_name
))
print
(
'destination directory: '
,
DESTINATION_DIR
)
print
(
'destination directory: '
,
DESTINATION_DIR
)
...
...
LectureSummarizingApp/api.py
View file @
b96dbe0f
...
@@ -14,6 +14,7 @@ import datetime
...
@@ -14,6 +14,7 @@ import datetime
# APIs used in Lecture Summarizing Component
# APIs used in Lecture Summarizing Component
from
.ExtractKeySentences
import
GetLectureNotice
from
.Summary
import
LectureSummary
from
.Summary
import
LectureSummary
from
.noise
import
noise_removal
from
.noise
import
noise_removal
from
.speech_to_text
import
speech_to_text
from
.speech_to_text
import
speech_to_text
...
@@ -106,7 +107,7 @@ class audioToTextList(APIView):
...
@@ -106,7 +107,7 @@ class audioToTextList(APIView):
# generate new id for speech to text file
# 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
)
speech_to_text
(
speech_to_text_name
)
...
@@ -180,11 +181,11 @@ class LectureNoticeList(APIView):
...
@@ -180,11 +181,11 @@ class LectureNoticeList(APIView):
# generate new id for notice
# generate new id for notice
notice_id
=
"LN0001"
if
lecture_notice_list
is
None
else
generate_new_id
(
lecture_notice_list
.
lecture_notice_id
)
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
(
LectureNotices
(
lecture_notice_id
=
notice_id
,
lecture_notice_id
=
notice_id
,
lecture_audio_id
=
id
,
lecture_audio_id
_id
=
id
,
notice_text
=
text
notice_text
=
text
)
.
save
()
)
.
save
()
return
Response
({
"response"
:
request
.
data
})
return
Response
({
"response"
:
request
.
data
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment