Как подсказать gpt чтобы он не ошибался с временным окномPython

Программы на Python
Ответить Пред. темаСлед. тема
Anonymous
 Как подсказать gpt чтобы он не ошибался с временным окном

Сообщение Anonymous »

Я пытаюсь извлечь состояние недвижимости из описания недвижимости. В частности, любой объект недвижимости, который ремонтируется в 2020 году или позже, должен быть помечен как «JUST_RENOVATED», тогда как, если ремонт проводился до 2020 года, он должен быть просто помечен как «ХОРОШИЙ».
Вот пример:
При следующем описании:

Entièrement rénovée en 2017, cette jolie maison 2 chambres vous séduira par ses pièces épurées et lumineuses. PEB exceptionnel (PEB A) grâce à la qualité d'isolation utilisée. Faible consommation de gaz pour le chauffage central. Châssis triple vitrage. Cuisine ouverte entièrement équipée. Installation électrique aux normes RGIE. Compteur bi-horaire. Pour plus de renseignements et pour participer aux prochaines visites, merci de contacter l'agence immobilière ASTON & PARTNERS au 081/30.44.44.
Состояние объекта должно быть «ХОРОШЕЕ».
Однако GPT, похоже, испытывает трудности с пониманием временного окна. Обычно он будет помечен как «JUST_RENOVATED», что подтверждает его нахождение в окне времени ремонта (несмотря на то, что 2017 год наступает раньше 2020 года).
Вот подсказка, которую я использовал: «Как я могу ее улучшить?» р>
Extract the property condition based on descriptions.

Follow this order of decision :
1. Tag any property that has been renovated recently (i.e. 2020 and above) by "JUST_RENOVATED". If renovation have been made before 2020, tag by "GOOD".
2. Tag any property that has been recently build or is a project by "AS_NEW".
3. Tag any property with need of restorations by "TO_RENOVATE".
4. Tag any property in good condition (i.e. good energetic performance) by "GOOD".
5. If none of the above tag suit the description, tag by "NOT_FOUND".

Answer only with the tag.

В конце концов, код Python, если это может помочь:
def debug_prompt(description):
intro_message = f"""
Extract the property condition based on descriptions.

Follow this order of decision :
1. Tag any property that has been renovated recently (i.e. 2020 and above) by "JUST_RENOVATED". If renovation have been made before 2020, tag by "GOOD".
2. Tag any property that has been recently build or is a project by "AS_NEW".
3. Tag any property with need of restorations by "TO_RENOVATE".
4. Tag any property in good condition (i.e. good energetic performance) by "GOOD".
5. If none of the above tag suit the description, tag by "NOT_FOUND".

Answer only with the tag.
"""

system_message = [{"role": "system", "content": intro_message}]

debug_prompt = [{
"role": "user",
"content": f"""
Extract the estate condition from the following description: '''{description}'''.
"""
}]

messages = system_message + debug_prompt

response = client.chat.completions.create(
model="gpt-3.5-turbo",
messages=messages,
temperature=0,
)

for response in response.choices:
print(response.message.content.strip())


Подробнее здесь: https://stackoverflow.com/questions/784 ... ime-window
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «Python»