0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【LLM文章校正】"隣の脚はよく牡蠣食う格だ"

Posted at

問:次の文章を校正せよ。"隣の脚はよく牡蠣食う格だ"

考察
PLaMoは慣用句と判定し、(頭文字が)近い慣用句を持ってきた?
gpt-4oは形態素毎に文脈の意味がとおるように修正していると思われる。

PLaMoを使った場合

隣の芝生は青い」ということわざと「脚」を「牡蠣」に置き換える間違いが起きていると考えられます。
正しくは「隣の芝生は青い」もしくは「隣の芝生はよく見える」となります。

よって、校正後の文章は「隣の芝生はよく牡蠣食う格だ」→「隣の芝生は青い」もしくは「隣の芝生はよく見える」となります。

「格」という単語は文脈によって意味が変わるため、校正対象としていません。
もし別の意味で使用されている場合はご教示ください。

gpt-4oを使った場合

隣の客はよく牡蠣を食う客だ。

PlaMo ver sample code

main.py
from openai import OpenAI
import os

client = OpenAI(
    base_url="https://platform.preferredai.jp/api/completion/v1",
    api_key = os.getenv("PLAMO_API_KEY")
)

def proofreading(target: str):
    try:
        query = f"以下の文章を校正しろ。「{target}"
        res = client.chat.completions.create(
            model="plamo-1.0-prime",
            messages=[
                {
                    "role": "system",
                    "content": "",
                },
                {"role": "user", "content": query}
            ],
            max_tokens=4000,
            temperature=0,
            top_p=0.8
        )
        return res.choices[0].message.content.strip()
    except Exception as e:
        return f"エラーが発生しました: {e}"

def run():
    query = "隣の脚はよく牡蠣食う格だ"
    response = proofreading(query)
    print(response)

if __name__ == "__main__":
    run()
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?