Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
funasr_web
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 7d2a5828
authored
Aug 22, 2024
by
‘chizw’
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[+]配置优化
1 parent
8217ea97
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
funasr_service.py
kafka_service/test01.py
funasr_service.py
View file @
7d2a582
...
@@ -237,7 +237,7 @@ def test_comparison_transform_output(sentence_info):
...
@@ -237,7 +237,7 @@ def test_comparison_transform_output(sentence_info):
time
=
add_milliseconds_to_time
(
initial_time
,
one
[
"start"
])
.
strftime
(
"
%
H:
%
M:
%
S"
)
time
=
add_milliseconds_to_time
(
initial_time
,
one
[
"start"
])
.
strftime
(
"
%
H:
%
M:
%
S"
)
spk
=
str
(
one
[
"spk"
])
spk
=
str
(
one
[
"spk"
])
text
=
one
[
"text"
]
text
=
one
[
"text"
]
#
output.append(f"[{time}] {spk}:{text}")
output
.
append
(
f
"[{time}] {spk}:{text}"
)
print
(
f
"[{time}] {spk}:{text}"
)
print
(
f
"[{time}] {spk}:{text}"
)
return
output
return
output
...
...
kafka_service/test01.py
View file @
7d2a582
...
@@ -48,20 +48,20 @@ def insert_run():
...
@@ -48,20 +48,20 @@ def insert_run():
def
run
(
url
,
name
=
None
):
def
run
(
url
,
name
=
None
):
now
=
datetime
.
now
()
now
=
datetime
.
now
()
# 格式化时间
formatted_now
=
now
.
strftime
(
'
%
Y-
%
m-
%
d_
%
H-
%
M-
%
S'
)
if
url
is
None
:
if
url
is
None
:
url
=
'C:
\\
Users
\\
chizw
\\
Desktop
\\
zhanggy202407100001.wav'
url
=
'C:
\\
Users
\\
chizw
\\
Desktop
\\
zhanggy202407100001.wav'
res
=
funasr_service
.
FunasrService
(
url
)
.
transform
()
res
=
funasr_service
.
FunasrService
(
url
)
.
transform
()
# print(f"res:{str(res)}")
# print(f"res:{str(res)}")
print
(
f
"url:{str(url)}"
)
print
(
f
"url:{str(url)}"
)
output
=
funasr_service
.
test_comparison_transform_output
(
res
[
0
][
"sentence_info"
])
# 格式化时间
formatted_now
=
str
(
now
.
strftime
(
'
%
Y-
%
m-
%
d_
%
H-
%
M-
%
S'
))
if
name
is
None
:
if
name
is
None
:
basename
,
extension
=
os
.
path
.
splitext
(
os
.
path
.
basename
(
url
))
basename
,
extension
=
os
.
path
.
splitext
(
os
.
path
.
basename
(
url
))
name
=
basename
name
=
basename
output
=
funasr_service
.
test_comparison_transform_output
(
res
[
0
][
"sentence_info"
])
with
open
(
f
'../log/{name}_{formatted_now}.txt'
,
'w'
,
encoding
=
'utf-8'
)
as
file
:
for
text
in
output
:
for
text
in
output
:
with
open
(
f
'../log/{name}_{formatted_now}.txt'
,
'a'
)
as
file
:
file
.
write
(
"
%
s
\n
"
%
text
)
file
.
write
(
text
)
# print(f"sentence_info:{funasr_service.fine_grained_transform_output(res[0]['sentence_info'])}")
# print(f"sentence_info:{funasr_service.fine_grained_transform_output(res[0]['sentence_info'])}")
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment