Skip to content

關於上下文聯想的輸入方法討論 #1004

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

Open
3 of 9 tasks
swoiow opened this issue Apr 8, 2025 · 4 comments
Open
3 of 9 tasks

關於上下文聯想的輸入方法討論 #1004

swoiow opened this issue Apr 8, 2025 · 4 comments

Comments

@swoiow
Copy link

swoiow commented Apr 8, 2025

關於上下文聯想的輸入方法討論。首先,issue上看到比較多人提及。那么,我自己個人是希望可以在lua裏面調用本地的onnx,這是當前的計劃。

實現計劃我需要:

  • 獲取輸入法上下文
    • 滑動上下文的獲取
      • 假設我在n秒內的輸入作為上下文,lua hook 在Processor 還是 Segment ? 這個問題區分漢字或者键入碼
      • 輸入法主程序是不是會更容易bug ( PS測試發現有小小問題,其次按键码的第一個按键沒被捕獲
  • 訓練及部署一個簡單的模型(或者直接从英文开始着手)
  • 已經知道的問題,delay,ms級別的話,要求電腦配置要有一定的cpu運算
  • PC版下面,UI支持手機的表現方式,即連續輸入的實現
    • 預設想,按esc停止聯想,可選遇到标点結果,實際上,可以替換非漢字爲占位符,遇到占位符停止

另外討論,

  • 關於中context的聯想,是不是試過使用Tire+Bayes ,而Tire子節點<=10。
  • 投影算法 我理解是不是贝叶斯的意思?

感謝作者的輸入法框架,提供了非常轻量,簡潔的選擇。


嘗試合併同類issue:

  • rime /librime/issues/882
  • rime /librime/issues/568

相關聯的功能:

  • rime /librime/issues/49
  • rime /librime/issues/544
@lotem
Copy link
Member

lotem commented Apr 15, 2025

啥叫「滑動上下文」?

這個代碼庫裏沒有 lua,要支持 lua 腳本須使用 librime-lua 插件。

拼寫運算裏提到投影算法,是拼寫運算過程的數學表達。拼寫運算是按方案中指定的規則對輸入碼變形。

@swoiow
Copy link
Author

swoiow commented Apr 15, 2025

啥叫「滑動上下文」?

@lotem 英文是rolling windows,这个我已经有了。我现在的版本是10秒内的input history。

  • 大概的数据流:用户 -> weasel -> input history -> http to golang/python -> model to guess the words(<5) -> lua hook to weasel -> yield

有没有方式可以连续键入,跟手机UI一样。譬如:我 -> 按1上屏:是 -> 按1上屏:中国 -> 按1上屏:人 -> 遇到或者按了esc,停止UI交互,退出输入法,直到再按键盘。

@sbxlm
Copy link

sbxlm commented Apr 20, 2025

@swoiow
Copy link
Author

swoiow commented Apr 22, 2025

@sbxlm 好的,我看看是什么方法。我见lua比较灵活,但是实际上,调试起来也有小问题

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

No branches or pull requests

3 participants