Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

英文文本会自动翻译 #115

Open
19 tasks
FreedomXD opened this issue Dec 11, 2023 · 3 comments
Open
19 tasks

英文文本会自动翻译 #115

FreedomXD opened this issue Dec 11, 2023 · 3 comments

Comments

@FreedomXD
Copy link

我有一批英文录音,想自动输出字幕但结果不甚理想,主要是会出现自动翻译的问题。以下是一段六级英语听力的转录结果

exts generated from A3_wKgMbl2yw1yiIds-AGX_jo0hufs184.srt.Mark the sentences to keep for autocut.
The format is [subtitle_index,duration_in_second] subtitle context.

  • [1,00:00] College English Test
  • [2,00:02] < No Speech >
  • [3,00:05] 听听 Comprehension
  • [4,00:06] < No Speech >
  • [5,00:12] 你会听到两场长的谈话
  • [6,00:14] 在每个谈话的结束
  • [7,00:16] 你会听到四个问题
  • [8,00:19] 两个话题和问题只会一次发生
  • [9,00:24] 请不吝点赞 订阅 转发 打赏支持明镜与点点栏目
  • [10,00:30] C and D
  • [11,00:32] 然后在答案项目一上
  • [12,00:35] 与一个线线通过中间
  • [13,00:37] < No Speech >
  • [14,00:39] 哇,我会给任何事情都像Audrey Hepburn一样
  • [15,00:44] 我从来没有理解为什么这么多女孩是她的大粉丝
  • [16,00:50] < No Speech >
  • [17,00:51] 我看过有名的电影
  • [18,00:52] 《罗门假期》
  • [19,00:54] 《早餐在蒂芬妮》
    ......

原文都是英文,但转录出来的是中文。

请求参数:autucut -d .data/ --whisper-model=large

另外由于国内网络环境使用,我把transcribe.py中的62行以下的vad_model请求换成了使用本地文件
‘’’
if self.vad_model is None or self.detect_speech is None:
# torch load limit pytorch/vision#4156
torch.hub._validate_not_a_forked_repo = lambda a, b, c: True
#self.vad_model, funcs = torch.hub.load(
# repo_or_dir="snakers4/silero-vad", model="silero_vad", trust_repo=True
#)
self.vad_model, funcs = torch.hub.load(
repo_or_dir="/root/.cache/torch/hub/snakers4_silero-vad_master/", model="silero_vad", trust_repo=True, source='local'
)
self.detect_speech = funcs[0]
‘’‘

@FreedomXD FreedomXD changed the title 识别英文视频会自动翻译 英文文本会自动翻译 Dec 11, 2023
@chenqianhe
Copy link
Collaborator

parser.add_argument(

--lang 指定语言

@FreedomXD
Copy link
Author

parser.add_argument(

--lang 指定语言

如果是中英文混合的音频,这里怎么指定好呢?我想让它中文的返回中文,英文的返回英文,谢谢!

@chenqianhe
Copy link
Collaborator

指定中文然后纯靠模型表现或者也许只能提前划分音频?如果指定语言为英文模型会把所有内容翻译为英文。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants