【问题标题】:How to make an offline translator? [closed]如何制作离线翻译? [关闭]
【发布时间】:2019-04-04 05:23:24
【问题描述】:

**问题:**

  • 结果必须是工作翻译 - 脱机。
    我们需要类似于 Google 翻译的 http API(自托管)。


我找到了几个选项:

  • 在Windows上安装Microsoft Translator,下载字典,并通过http传输请求在那里翻译
  • Apertium,这个选项更接近现实,但不清楚如何设置一切......
  • Apache Joshua
  • Promt,很完美,就是太贵了
  • 在PC上安装Android,已经有谷歌翻译了,但是又会出现发送http请求的问题

**待办事项:**

  • 我们需要翻译整个句子,而不仅仅是单个单词。
  • 也许有某种命令行实用程序。
    或者也许有适合 linux 的东西。


    以上哪个选项更适合查找更多信息?

【问题讨论】:

标签: neural-network translation translate apertium


【解决方案1】:

五分钟的解决方案是在 Debian 或 Ubuntu 上执行此操作:

sudo apt install apertium-apy      # http server for apertium
sudo apt install apertium-eng-spa  # install some language data
sudo systemctl enable apertium-apy # start http server on next boot
sudo systemctl start apertium-apy  # start http server right now too

您现在可以在英语和西班牙语之间进行翻译,以响应 JSON 中的 http 请求和答案:

curl 'http://localhost:2737/translate?langpair=spa|eng&q=Eres+la+leche' 

您可以看到所有 apt-installable Apertium 语言对

apt-cache search apertium |grep 'pair$'

如果您想在 Apertium 中添加更多对,可以尝试使用未发布的数据添加 nightly apt 存储库(或考虑使用您自己的语言数据 Contributing)。


但是,您标记了这个神经网络——如果您想要 NN 或比 Apertium 更多的语言对,您可以使用 OpenNMT 和来自例如的数据来训练翻译器。 http://opus.nlpl.eu/ ,但这肯定需要五分钟以上 :-)

【讨论】:

    猜你喜欢
    • 2017-05-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-07-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多