Skip to content

Conversation

@vishv843
Copy link
Contributor

Previously, the title was simply created by putting the message when /transfer-questions command was invoked. The title had to be written by a human for clarity. This PR solves that issue by using ChatGPT for title generation. #1011

question
response

@vishv843 vishv843 requested a review from a team as a code owner March 19, 2024 03:28
@vishv843 vishv843 marked this pull request as draft March 19, 2024 04:10
@vishv843 vishv843 marked this pull request as ready for review March 20, 2024 03:35
@vishv843 vishv843 force-pushed the feat/title-generation branch from 31a0bee to 8a992ec Compare March 20, 2024 04:53
@vishv843
Copy link
Contributor Author

Hi @ankitsmt211. I have made the necessary changes. Please review it.

Taz03
Taz03 previously approved these changes Mar 20, 2024
@vishv843 vishv843 force-pushed the feat/title-generation branch 2 times, most recently from 1549aef to d590441 Compare March 21, 2024 20:08
Copy link
Member

@ankitsmt211 ankitsmt211 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is it from my side, good work
Thanks 👍

refactoring

reviewer comments addressed

prompt improved

Update prompt

Co-authored-by: alphaBEE <61616007+ankitsmt211@users.noreply.github.com>

removed tags
@vishv843 vishv843 force-pushed the feat/title-generation branch from 31897c4 to 7918d04 Compare March 24, 2024 20:57
@vishv843
Copy link
Contributor Author

I tested the prompt you gave on some questions, worked pretty well. I have added it. Thanks!!

@ankitsmt211
Copy link
Member

@vishv843 everything looks great, i wish i should have tested the prompt more before suggesting it. I tested it on a couple of more questions and it would return title in quotation marks sometimes, so i finally decided to ask gpt itself for a better prompt. Now this one i validated against more than 4-5 questions from server itself so seems to be solid overall.

image

String chatGptPrompt = "Create a concise title for the question: '%s'. The title should be 4-5 words maximum and presented without quotation marks."
    .formatted(originalMessage);

I'd be fine with doing the changes myself if it's a bother 😅

@Taz03
Copy link
Member

Taz03 commented Mar 25, 2024

@ankitsmt211 imo its better to just check for quotes and remove them manually, gpt sometimes does things even when told not to

if (title.matches("['\"]\\w+['\"]")) title = title.substring(1, gptTitle.length() - 1);

@ankitsmt211
Copy link
Member

@ankitsmt211 imo its better to just check for quotes and remove them manually, gpt sometimes does things even when told not to

if (title.matches("['\"]\\w+['\"]")) title = title.substring(1, gptTitle.length() - 1);

this is very specific and if GPT is unreliable then we can't really handle all other cases, so imo just trying for best prompt that we can should be a priority, if you're specific with prompt it does work as expected specially when generating simple text is what it's known about.

@ankitsmt211 ankitsmt211 requested a review from Taz03 May 12, 2024 13:04
@ankitsmt211 ankitsmt211 merged commit 10718cb into Together-Java:develop May 14, 2024
@ankitsmt211 ankitsmt211 mentioned this pull request May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants