anaclumos / signalkite

🪁 notifies you based on your algo
http://hn.cho.sh
MIT License
130 stars 6 forks source link

Title string looks too wordy #66

Closed rishubil closed 5 months ago

rishubil commented 5 months ago

Some title strings are displayed too long in https://hn.cho.sh/ko/2024/06/12/

Example:

anaclumos commented 5 months ago

Thank you for your report! 감사해요!

This is likely because of the recent transition to GPT-4o.

Heimdall used DeepL for translations for a long time, but due to extremely high costs (~$300/mo), I migrated to GPT-4o yesterday.

In the prompt, there was a mention where I asked to "act as if this is a newspaper."

https://github.com/anaclumos/heimdall/blob/7aff76fcb8452c4fb3ad1930575b00fce5adb6bb/scripts/translate.mts#L44

https://github.com/anaclumos/heimdall/blob/7aff76fcb8452c4fb3ad1930575b00fce5adb6bb/scripts/default.mts#L617-L649

And this caused the problem.

I removed this prompt and added, "ONLY TRANSLATE WHAT IS GIVEN".

https://github.com/anaclumos/heimdall/blob/2edc921a282771cfe1d630d1a9f10f59275ac639/scripts/translate.mts#L47

https://github.com/anaclumos/heimdall/blob/2edc921a282771cfe1d630d1a9f10f59275ac639/scripts/default.mts#L617-L649

My test confirmed that this improves the title generation!