Code Monkey home page Code Monkey logo

sumibi's People

Contributors

kiyoka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

emacsmirror

sumibi's Issues

同音異義語の変換候補のリストアップが弱いので強化して欲しい

概要

ChatGPT APIだけでは、十分な数の同音異義語をリストアップすることは難しい。
クライアント側(EmacsLisp側)に同音異義語辞書を保持し、同音異義語の解決をするなど、機能強化する。

課題

例えば、以下をSumibi 1.9.0で変換した場合、単語が短すぎて、有効な同音異義語がリストアップできない。

  • 変換対象の入力文字列

    kansei

  • 変換結果(同音異義語の列挙結果は一つのみ)

    完成

  • 一方、SKK-JISYO.Lに入っている同音異義語は以下のように豊富なため、これくらいのリストは出してほしい。

    完成/感性/歓声/閑静/管制/慣性/寛政/官製/乾性/陥穽/官制/間性/喚声/甘精/甘井/喊声/監製/感声/乾生/関西

OpenAI APIのステータスコードのエラーに対応する

English: Responding to OpenAI API status code errors. If the status code is not 200, please display the error message returned by the API in the mini-buffer.

ステータスコードが200以外の場合は、APIが返すエラーメッセージをミニバッファに表示してほしい。
次の例は、ステータスコード429 Too Many Requestsのエラーケースです。

HTTP/1.1 429 Too Many Requests
Date: Wed, 24 May 2023 11:19:00 GMT
Content-Type: application/json
Content-Length: 349
Connection: keep-alive
access-control-allow-origin: *
openai-model: gpt-3.5-turbo-0301
openai-organization: xxxxxxxxxxxxxxxxxxxxxxxxx
openai-processing-ms: 30014
openai-version: 2020-10-01
strict-transport-security: max-age=15724800; includeSubDomains
x-ratelimit-limit-requests: 3500
x-ratelimit-limit-tokens: 90000
x-ratelimit-remaining-requests: 3499
x-ratelimit-remaining-tokens: 88989
x-ratelimit-reset-requests: 17ms
x-ratelimit-reset-tokens: 674ms
x-request-id: 24eaad501de52f18620f2fd21e5e52e9
CF-Cache-Status: DYNAMIC
Server: cloudflare
CF-RAY: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
alt-svc: h3=":443"; ma=86400, h3-29=":443"; ma=86400

{
  "error": {
    "message": "That model is currently overloaded with other requests. You can retry your request, or contact us through our help center at help.openai.com if the error persists. (Please include the request ID 24eaad501de52f18620f2fd21e5e52e9 in your message.)",
    "type": "server_error",
    "param": null,
    "code": null
  }
}

GPT-3.5-TurboとGPT-4のモデルを動的に切り替えられるようにしたい

カスタマイズ変数 sumibi-current-model に設定したモデルを、途中で切り替えれるようにしたい。
別のカスタマイズ変数に、複数のモデル名を定義しておいて、いつでも選択できるようにしたい。

背景

モデルgpt-4は変換精度は非常に高いが、API課金が高いので、長文の翻訳などの作業ではgpt-3.5-turboに切り替えたい。

対応方法

  • 変換候補のポップアップの選択候補に、「gpt-3.5-turboへ切り替え」「gpt-4へ切り替え」などの選択項目が出てきて、選択するとそのモデルに動的に切り替えられる。

ひらがな1文字づつの入力時、変換候補にカタカナも追加する

English: When inputting a single Hiragana character, Katakana candidates are also added to the conversion options.

Sumibi ver 1.6.2 の動作

  1. 1文字のローマ字を入力して変換する
a[Ctrl-J]
  1. 複数回Ctrl-Jを押下する
あ[Ctrl-J][Ctrl-J][Ctrl-J]
  1. 変換候補がひらがなの候補1個だけしかない
image

期待動作

ひらがなとカタナナの2つの候補が表示され、選択可能になる

image

gpt-4のモデルに対応する

  • gpt-3.5-turboの精度が悪い箇所を微調整していた部分をgpt-4には解法する。
    例えば、以下のようなアドホックな対応は不要となる。
(defun sumibi-drop-guide-sentence (utf8-str)
  "引数UTF8-STRで指定した文字列中のgpt-3.5-turboが出力する不要な定型文を削除する."
  (let ((lines (split-string utf8-str "\n")))
    (if
        (or (string-match "以下の通りです。[ ]*" (car lines))
            (string-match "以下のようになります。[ ]*" (car lines))
            (string-match "以下になります。[ ]*" (car lines)))
        (string-trim-left (string-join (cdr lines) "\n"))
      utf8-str)))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.