#How to train a bot where it can answer to product related queries

30 messages · Page 1 of 1 (latest)

ocean dew
#

eg:

Brand_Name Category Price
ABC Bat $12
XYZ Bat $14
MNZ Bat $13

Now, when I ask

  • a) Q: suggest me the cheapest bat brand and its price?
    A: ABC is of price $12
  • b) Q: suggest me the cheapest bat brand and its price?
    A: XYZ is of price $14
  • c) Q: suggest me top two cheapest bat brand and its price ?
    A: ABC and MNZ is of price $12 and $13
  • d) Q: Suggest me bat brands which has price between 12 and 13 dollars?
    A: ABC and MNZ

I tried using embedding approach which is suggested here ( https://stackoverflow.com/questions/74000154/customize-openai-model-how-to-make-sure-answers-are-from-customized-data )
No luck yet

lilac bay
#

What issues are you having with the embeddings approach? Like the stackoverflow answer, I agree that embeddings are the best way to go here

ocean dew
#

@lilac bay with embeddings, we have to prepare training data with all scenarios

prompt completion
Price of ABC $12
Price of XYZ $14
Price of MNZ $13

Now when i ask what is the cheapest price of bat then it is not able to answer it

ocean dew
#

eg: If I ask which is the cheapest product then with embedding it not able to answer it

worn rapids
#

I once sent there a tutorial of searching with text embedding

worn rapids
#

If you train it: prompt:A Output: B

#

then if you send A to it it will more likely to answer B

#

It’s different from storing a certain data into a model

ocean dew
#

It gives random output for some cases
eg:

Now, when I ask
Enter product name Toe Synthetic Flip Flop Sandal
{
"choices": [
{
"finish_reason": "length",
"index": 0,
"logprobs": null,
"text": "\n\nWomen's Shoes ->\n\nWomen's Shoes ->\n\nWomen's Shoes ->\n\n"
}
],

So, I feel both fine tuning and embedding will not solve my problem

ocean dew
#

Example 2:
Enter product namePrice of Josmo 8190 Plain Infant Walking Shoes, Navy
{
"choices": [
{
"finish_reason": "length",
"index": 0,
"logprobs": null,
"text": " 45.99\n\nPrice of Josmo 8190 Plain Infant Walking Shoes, Navy -> 45"
}
],

#

Code which I used:
import os
import openai

openai.api_key = "sk-xxxx"

query=input("Enter product name ")
response = openai.Completion.create(
model="davinci:ft-personal:s",
prompt=f"{query} ->",
temperature=0.2,
max_tokens=20,
)
print(response)

worn rapids
#

How many times have you finetuned, It seems that only finetuned after many times can the model work as you desired

#

I personally prefer textembedding

#

let me have a try

#

please wait for hours

ocean dew
#

Sure, Thanks

olive cypress
worn rapids
#

Finished, I just build it in a discord bot

#

Maybe a little stupid, just a basic one

#

I love text embedding!!!💕

#

I'm improving my code for a better chat experience now

#

DM me if you need the code frame, I will also post here in the support later as a tutorial