From entities/attributes to description

Hello,

I’d like to build a simple app that would write a description from entities/attributes. For example, a bottle of wine has these properties:

Gewürztraminer

Winery: Trimbach
Region: Alsace
Year: 2016
Aromas: lychee, tropical, pineapple, mango, passion fruit, papaya, kiwi, guava
Food pairings: Salmon, tuna, spicy food, poultry, mild and soft cheese

What would be the best practices for structured data input and which model/framework would you recommend using?

P.S. Here is my manual shot with Summarize for a 2nd grader:

The Trimbach family has been making wine for over 400 years in the Alsace region of France. The Trimbach winery was founded when Jean Trimbach purchased vineyards in 1585, and today his great-great-grandson Jean-Marie Trimbach is the owner and winemaker.

Trimbach has been producing Gewürztraminer since 1750. The name Gewürztraminer translates to “spicy traminer” and refers to the spicy character of the wine. Gewürztraminer is a white grape variety that is used in Alsace, Germany, Austria and Switzerland.

Trimbach’s Gewürztraminer is made exclusively from grapes grown in the villages of Bergheim and Turckheim in Alsace. The grapes are hand-harvested, then crushed and fermented for 8–10 days. The wine is aged for 10 months in oak casks, which are 50% new.

The result is a wine that is aromatic, fruity and spicy. The nose is filled with aromas of lychee, tropical fruit, pineapple, mango, passion fruit and papaya. The palate is also rich with tropical fruits like guava and kiwi.

This Gewürztraminer has a dry and crisp finish that makes it perfect for pairing with salmon, tuna or spicy food. It also pairs well with poultry and milder cheeses like Brie or Camembert.

1 Like

Your attempt looks great! Is there anything in particular you’d like to change?

We recommend you use davinci or davinci-instruct-beta when you’re experimenting, since it will give the best completions. Once you’re ready to move your use case to production, we encourage you to try the other models to see if you get the same results but with lower latency.

Yes I’m using Davici and davinci-instruct-beta.

My exact input is:

Gewürztraminer

Winery: Trimbach
Region: Alsace
Year: 2016
Aromas: lychee, tropical, pineapple, mango, passion fruit, papaya, kiwi, guava
Food pairings: Salmon, tuna, spicy food, poultry, mild and soft cheese

I’ve got other outputs such as this:

The wine is golden in color. The aromas are lychee, tropical, pineapple, mango, passion fruit, papaya, kiwi, guava.
The wine is on the sweet side and pairs well with salmon, tuna, spicy food and poultry. It goes well with mild and soft cheese.

which is ok, but misses details such as winery, region and etc.

Also, I get a repeated output that looks almost identical to input, I mean nothing is changed, see below:

Winery: Trimbach
Region: Alsace
Year: 2016
Aromas: lychee, tropical, pineapple, mango, passion fruit, papaya, kiwi, guava
Food pairings: Salmon, tuna, spicy food, poultry, mild and soft cheese

I’m attaching my config, maybe you can advise how to achieve results to my first example?

You can increase the “presence penalty” on the right, which is currently set at 0.

You can provide examples of input → output according to your desired descriptions.

I recommend reading prompt design 101 and checking out some prompt examples to see how that works.

I will second Joey here - this kind of task (in my experience) has a very high risk of confabulation. So here’s how I’d approach it. The instruct-beta engines are really good at generating prose in pretty much any style you can describe.

And then you can have some fun with it:

Okay, I’m having too much fun with this, I’ll stop now

2 Likes