Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2021-060
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
2021-060
2021-060
Commits
0e9d90dd
Commit
0e9d90dd
authored
Jul 04, 2021
by
chalikaM
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clearness of the speech
parent
892eb4b8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
0 deletions
+50
-0
clearness.py
clearness.py
+50
-0
No files found.
clearness.py
0 → 100644
View file @
0e9d90dd
import
spacy
from
scipy.io.wavfile
import
read
import
numpy
as
np
import
matplotlib.pyplot
as
plt
from
pydub
import
AudioSegment
import
os
import
glob
#Identify ocer complex words
nlp
=
spacy
.
load
(
"en_core_web_sm"
)
doc
=
nlp
(
"Apple is looking at buying U.K. startup for $1 billion accumulativeness. This ia a dog. <y name is Chalika Mihiran"
)
for
token
in
doc
:
count
=
len
(
token
)
if
count
>
12
:
print
(
f
"{token.text} - {count}: This is a too complicated word"
)
#Identify over complex sentences
for
sent
in
doc
.
sents
:
word_count
=
0
# print(sent.text)
for
words
in
sent
:
# print(words.text)
word_count
=
word_count
+
1
# print(word_count)
sentence_tokens
=
[
sent
for
sent
in
doc
.
sents
]
# print(sentence_tokens)
# sentence_words = {}
# word_count = 0
# for sent in sentence_tokens:
# for token in sent:
# sentence_words[sent] = word_count + 1
# print(sentence_words)
#Calculate the rate of the speed
# Read the Audiofile
samplerate
,
data
=
read
(
'C:/Users/CHALIKA PC/Desktop/Year 04/Research/Audio/videoplayback_1_.wav'
)
# Frame rate for the Audio
# print(samplerate)
# Duration of the audio in Seconds
duration
=
len
(
data
)
/
samplerate
print
(
"Duration of Audio in Seconds"
,
duration
)
print
(
"Duration of Audio in Minutes"
,
duration
/
60
)
# print(len(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