Prompt Hub - 使用大型語言模型進行文本摘要(Text Summarization with LLMs)

使用大型語言模型進行文本摘要(Text Summarization with LLMs)

本段包含一組用於探索大型語言模型文本摘要能力的提示集合。


目錄


使用大型語言模型解釋概念

背景

以下提示旨在測試大型語言模型解釋或摘要概念的能力。

提示詞

抗生素是一種用於治療細菌感染的藥物。它們透過殺死細菌或抑制其繁殖來發揮作用,幫助身體的免疫系統對抗感染。抗生素通常以藥丸、膠囊或液體形式口服,有時也會靜脈注射。抗生素對病毒感染無效,不當使用可能導致抗生素抗藥性。

**請用一句話解釋上述內容:**

程式

from openai import OpenAI
client = OpenAI()
 
response = client.chat.completions.create(
model="gpt-4",
messages=[
    {
    "role": "user",
    "content": "Antibiotics are a type of medication used to treat bacterial infections. They work by either killing the bacteria or preventing them from reproducing, allowing the body’s immune system to fight off the infection. Antibiotics are usually taken orally in the form of pills, capsules, or liquid solutions, or sometimes administered intravenously. They are not effective against viral infections, and using them inappropriately can lead to antibiotic resistance.\n\nExplain the above in one sentence:"
    }
],
temperature=1,
max_tokens=250,
top_p=1,
frequency_penalty=0,
presence_penalty=0
)
import fireworks.client
fireworks.client.api_key = "<FIREWORKS_API_KEY>"
completion = fireworks.client.ChatCompletion.create(
    model="accounts/fireworks/models/mixtral-8x7b-instruct",
    messages=[
        {
        "role": "user",
        "content": "Antibiotics are a type of medication used to treat bacterial infections. They work by either killing the bacteria or preventing them from reproducing, allowing the body’s immune system to fight off the infection. Antibiotics are usually taken orally in the form of pills, capsules, or liquid solutions, or sometimes administered intravenously. They are not effective against viral infections, and using them inappropriately can lead to antibiotic resistance.\n\nExplain the above in one sentence:",
        }
    ],
    stop=["<|im_start|>","<|im_end|>","<|endoftext|>"],
    stream=True,
    n=1,
    top_p=1,
    top_k=40,
    presence_penalty=0,
    frequency_penalty=0,
    prompt_truncate_len=1024,
    context_length_exceeded_behavior="truncate",
    temperature=0.9,
    max_tokens=4000
)

References

Text Summarization with LLMs


目錄:Prompt Hub - 提示詞匯集

上一篇:Prompt Hub - 使用大型語言模型進行推理 (Reasoning with LLMs)
下一篇:Prompt Hub - 大型語言模型的真實性 (Truthfulness in LLMs)