Textaufforderungen erstellen

Auf dieser Seite erhalten Sie eine Übersicht über die allgemeine Konfiguration von Text-Prompts.


Klicken Sie auf Anleitung, um eine detaillierte Anleitung für diese Aufgabe direkt in der Google Cloud Console aufzurufen.

Anleitung


Unterstützte Modelle

  • text-bison
  • text-bison-32k
  • text-unicorn
  • gemini-1.0-pro

Prompt-Struktur

Sie können Kontextinformationen, Anleitungen, Beispiele, Fragen, Listen und alle anderen Arten von Textinhalten hinzufügen, die Sie sich vorstellen können. Versehen Sie den Textinhalt mit Labels, indem Sie dem Text Präfixe hinzufügen. Ein Präfix kann ein Wort oder eine Wortgruppe sein, die mit einem Doppelpunkt (:) endet. Beispiel:

  • Text:
  • Frage:
  • Antwort:
  • Kategorien:
  • Optionen:

Sie können beliebige Präfixe verwenden, aber für eine bestimmte Aufgabe funktionieren möglicherweise einige Präfixe besser als andere. Achten Sie außerdem darauf, im Prompt konsistent auf Präfixe zu verweisen.

Inkonsistente Referenz: In der Anleitung werden die Begriffe Stimmung und Tweet verwendet, die Präfixe sind jedochText: und Antwort:.


Classify the sentiment of the following tweet as positive or negative.
Text: I love chocolate.
Answer:
      

Konsistente Referenz: Die Präfixe Text: und Stimmung: entsprechen den in der Anleitung verwendeten Begriffen.


Classify the sentiment of the following text as positive or negative.
Text: I love chocolate.
Sentiment:
      

Gängige Aufgabentypen

Sie können Text-Prompts für die Verarbeitung einer beliebigen Anzahl von Aufgaben erstellen. Zu den gängigsten Aufgaben zählen Klassifizierung, Zusammenfassung und Extraktion. Weitere Informationen zum Entwerfen von Text-Prompts für diese allgemeinen Aufgaben finden Sie auf den folgenden Seiten:

Prompts zur Klassifizierung

Klassifizierungsaufgaben weisen dem Text eine Klasse oder Kategorie zu. Sie können eine Liste mit Kategorien auswählen oder das Modell aus seinen eigenen Kategorien auswählen lassen. Auf dieser Seite erfahren Sie, wie Sie Prompts erstellen, die Text klassifizieren.

Anwendungsfälle für Klassifizierung

Im Folgenden sind einige gängige Anwendungsfälle für die Textklassifizierung aufgeführt:

  • Betrugserkennung: Klassifizieren Sie, ob Transaktionen in Finanzdaten betrügerisch sind oder nicht.
  • Spamfilter: Erkennen, ob es sich bei einer E-Mail um Spam handelt.
  • Sentimentanalyse: Klassifizieren Sie die im Text vermittelte Stimmung als positiv oder negativ. Sie können beispielsweise Filmrezensionen oder E-Mails als positiv oder negativ klassifizieren.
  • Inhalte moderieren: Identifizieren und melden Sie potenziell schädliche Inhalte wie anstößige Sprache oder Phishing.

Best Practices für Klassifizierung-Prompts

Versuchen Sie, die Temperatur auf null und Top-K auf eins zu setzen. Klassifizierungsaufgaben sind in der Regel deterministisch, sodass diese Einstellungen häufig die besten Ergebnisse liefern.

Beispiele für Klassifizierungs-Prompts

In den folgenden Beispielen wird gezeigt, wie Sie Klassifizierungs-Prompts für verschiedene Anwendungsfälle entwerfen.

Prompt zur Sentimentanalyse

Bei der Sentimentanalyse werden Text ausgewertet und als positiv oder negativ klassifiziert. Die Einbindung einer Sentimentanalyse in einen Prompt ist nützlich, wenn Sie Inhalte wie Rezensionen, Feedback und E-Mails analysieren möchten.

Im folgenden Prompt wird die Stimmung einer Rezension klassifiziert:


Give the sentiment of this review.
Review: This is a shoe I will wear with black dress pants or jeans when I need comfort and a little style, but I am not impressed. This is a very flimsy shoe with little support at all. Unlike any other shoes I've purchased in the past. It looks nice, but it's not comfortable.
  

Negative
  

Sie können festlegen, dass das Modell die Begründung hinter seiner Antwort zurückgibt, indem Sie es anweisen, die Begründung zu erklären.


Give the sentiment of this review and explain your reasoning.
Review: This is a shoe I will wear with black dress pants or jeans when I need comfort and a little style, but I am not impressed. This is a very flimsy shoe with little support at all. Unlike any other shoes I've purchased in the past. It looks nice, but it's not comfortable.
  

Negative

The reviewer expresses disappointment with the shoe's lack of support and comfort, despite its stylish appearance. The reviewer also mentions that the shoe is flimsy and not like any other shoes they have purchased in the past. They say that the shoe looks nice, but it's not comfortable, which suggests that the style of the shoe is not enough to compensate for its lack of comfort.
  

Sie können das Modell auch abrufen, um eine strukturiertere Antwort zu erstellen, die die Stimmung und eine Begründung enthält, warum diese Stimmung ausgewählt wurde.


For the given review, return a JSON object that has the fields sentiment and explanation. Acceptable values for sentiment are Positive or Negative. The explanation field contains text that explains the sentiment.
Review: This is a shoe I will wear with black dress pants or jeans when I need comfort and a little style, but I am not impressed. This is a very flimsy shoe with little support at all. Unlike any other shoes I've purchased in the past. It looks nice, but it's not comfortable.
  

```
{
"sentiment": "Negative",
"explanation": "The reviewer is not impressed with the shoe, calling it flimsy and lacking support. They also say that it is not comfortable, despite looking nice."
}
```
  

Prompt zur Inhaltsklassifizierung

Der folgende Prompt klassifiziert Kunden-E-Mails basierend auf den Anfragen im Inhalt.


Classify the text as one of the following categories:
- increase credit limit
- cancel credit card
- charge dispute

Text: I lost my wallet yesterday so I need to cancel my credit card and get a new one. My card number is 1234.
Category:
  

cancel credit card
  

Wenn die Anfrage in der E-Mail nicht eindeutig ist, müssen Sie sie möglicherweise an den Kundenservice senden, um weitere Informationen zu erhalten. Fügen Sie dazu eine Kategorie „Kundendienst“ hinzu und weisen Sie das Modell an, diese Kategorie auf Ausreißer anzuwenden, die weitere Informationen benötigen.


Classify the text as one of the following categories:
- increase credit limit
- cancel credit card
- charge dispute
If the text doesn't fit any categories, classify it as the following:
- customer service

Text: I want to remodel my bathroom. What are my options?
Category:
  

Customer service
  

Eine weitere Möglichkeit für den Umgang mit E-Mails, die weitere Informationen erfordern, ist die Verwendung von Beispielen dafür, wie mit Ausreißern umzugehen ist, die in keine anderen Kategorien passen.


Classify the text as one of the following categories:
- increase credit limit
- cancel credit card
- charge dispute
- customer service

Text: I need to buy a car.
Category: customer service
Text: But I was in Chicago.
Category: customer service
Text: Where are my papers?
Category: customer service

Text: I want to remodel my bathroom.
Category:
  

customer service
  

Prompt zur Filmklassifizierung

Der folgende Prompt klassifiziert Filme nach den Personen, mit denen Sie die Filme sehen sollte.


Classify the following movie as one of the following categories:
- watch alone
- watch with friends
- watch with family
- watch on a date

Text: The Goonies
Category:
  

Watch with friends
  

Möglicherweise müssen Sie eine eigene Kategorie definieren. Angenommen, Sie haben ein Tierhotel namens Remi Inn, das Filme für Haustiere zeigt. Die Filmauswahlkriterien könnten so lauten:

  • Der Hauptdarsteller muss ein Tier sein.
  • Der Film muss fröhlich sein.
  • Der Film darf nicht Zeichentrick sein.

Der folgende Prompt klassifiziert Filme, die alle drei Kriterien erfüllen, als Remi-tastic und alle anderen als Bark-fest.


Remi-tastic movies must meet the following criteria:
- The main character must be an animal.
- The movie must be family friendly.
- The movie cannot be a cartoon.
If a movie is not Remi-tastic, then it is Bark-fest.

Classify the movie as one of the following categories:
- Remi-tastic
- Bark-fest

Text: The Adventures of Milo and Otis
Category:
  

Remi-tastic
  

Der folgende Prompt enthält Anweisungen, um einen Grund für die Klassifizierung zurückzugeben und zu prüfen, ob das Modell die Kriterien verwendet oder eine Klassifizierung zufällig auswählt.


Remi-tastic movies must meet the following criteria:
- The main character must be an animal.
- The movie must be family friendly.
- The movie cannot be a cartoon.
If a movie is not Remi-tastic, then it is Bark-fest.

Classify the movie as one of the following categories:
- Remi-tastic
- Bark-fest
Explain why.

Text: The Adventures of Milo and Otis
Category:
  

Remi-tastic

Explanation: "The Adventures of Milo and Otis" is a live-action animal adventure movie featuring two main characters: Milo, a cat, and Otis, a pug. The movie is suitable for families of all ages and is not a cartoon. Therefore, it meets all three criteria for being Remi-tastic.
  

Aufforderungen zur Zusammenfassung

Bei Zusammenfassungsaufgaben werden die wichtigsten Informationen aus Text extrahiert. Sie können Informationen im Prompt angeben, damit das Modell eine Zusammenfassung erstellen kann, oder das Modell auffordern, selbst eine Zusammenfassung zu erstellen. Auf dieser Seite erfahren Sie, wie Sie Prompts entwerfen, um verschiedene Arten von Zusammenfassungen zu erstellen.

Anwendungsfälle für Zusammenfassung

Im Folgenden sind gängige Anwendungsfälle für die Zusammenfassung aufgeführt:

  • Text zusammenfassen: Textinhalt wie die folgenden zusammenfassen:
    • Nachrichtenartikel
    • Forschungsberichte
    • Rechtsdokumente
    • Finanzdokumente.
    • Technische Dokumente
    • Kundenfeedback
  • Inhaltsgenerierung: Generieren Sie Inhalte für einen Artikel, einen Blog oder eine Produktbeschreibung.

Best Practices

Beachten Sie beim Erstellen optimaler Textzusammenfassungen die folgenden Richtlinien:

  • Geben Sie alle Merkmale an, die die Zusammenfassung haben soll.
  • Wenn Sie weitere kreative Zusammenfassungen erhalten möchten, geben Sie Werte für die Höchst-, die Top-K- und die Top-P-Werte der Temperatur an. Weitere Informationen zu den Parametern temperature, topK und topP finden Sie unter Textparameterdefinitionen.
  • Wenn Sie einen Prompt schreiben, sollten Sie sich auf den Zweck der Zusammenfassung konzentrieren und wissen, was Sie damit erreichen wollen.

Beispiele für Prompts für Zusammenfassungen

In den folgenden Beispielen wird gezeigt, wie Sie Prompts für Zusammenfassungen für verschiedene Anwendungsfälle entwerfen.

Prompts für die Artikelzusammenfassung

Der folgende Prompt fasst die wichtigsten Punkte eines Artikels zusammen:


Provide a summary for the following article:
The efficient-market hypothesis (EMH) is a hypothesis in financial economics that states that asset prices reflect all available information. A direct implication is that it is impossible to 'beat the market' consistently on a risk-adjusted basis since market prices should only react to new information. Because the EMH is formulated in terms of risk adjustment, it only makes testable predictions when coupled with a particular model of risk. As a result, research in financial economics since at least the 1990s has focused on market anomalies, that is, deviations from specific models of risk. The idea that financial market returns are difficult to predict goes back to Bachelier, Mandelbrot, and Samuelson, but is closely associated with Eugene Fama, in part due to his influential 1970 review of the theoretical and empirical research. The EMH provides the basic logic for modern risk-based theories of asset prices, and frameworks such as consumption-based asset pricing and intermediary asset pricing can be thought of as the combination of a model of risk with the EMH. Many decades of empirical research on return predictability has found mixed evidence. Research in the 1950s and 1960s often found a lack of predictability (e.g. Ball and Brown 1968; Fama, Fisher, Jensen, and Roll 1969), yet the 1980s-2000s saw an explosion of discovered return predictors (e.g. Rosenberg, Reid, and Lanstein 1985; Campbell and Shiller 1988; Jegadeesh and Titman 1993). Since the 2010s, studies have often found that return predictability has become more elusive, as predictability fails to work out-of-sample (Goyal and Welch 2008), or has been weakened by advances in trading technology and investor learning (Chordia, Subrahmanyam, and Tong 2014; McLean and Pontiff 2016; Martineau 2021).
  

Summary:
The efficient-market hypothesis (EMH) is a theory in financial economics that states that asset prices reflect all available information. This implies that it is impossible to consistently beat the market on a risk-adjusted basis. The EMH has been extensively researched, with mixed results. Some studies have found evidence of return predictability, while others have not. Recent research suggests that return predictability has become more elusive in recent years due to advances in trading technology and investor learning. The EMH provides the basis for modern risk-based theories of asset prices and frameworks such as consumption-based asset pricing and intermediary asset pricing.
  

Sie können auch den gewünschten Zusammenfassungstyp angeben. Akademische und wissenschaftliche Fachzeitschriften enthalten beispielsweise oft Zusammenfassungen ihrer Artikel. Der folgende Prompt fordert das Modell auf, einen Zusammenfassung für den Text zu schreiben:


Write an abstract for this text:
The efficient-market hypothesis (EMH) is a hypothesis in financial economics that states that asset prices reflect all available information. A direct implication is that it is impossible to 'beat the market' consistently on a risk-adjusted basis since market prices should only react to new information. Because the EMH is formulated in terms of risk adjustment, it only makes testable predictions when coupled with a particular model of risk. As a result, research in financial economics since at least the 1990s has focused on market anomalies, that is, deviations from specific models of risk. The idea that financial market returns are difficult to predict goes back to Bachelier, Mandelbrot, and Samuelson, but is closely associated with Eugene Fama, in part due to his influential 1970 review of the theoretical and empirical research. The EMH provides the basic logic for modern risk-based theories of asset prices, and frameworks such as consumption-based asset pricing and intermediary asset pricing can be thought of as the combination of a model of risk with the EMH. Many decades of empirical research on return predictability has found mixed evidence. Research in the 1950s and 1960s often found a lack of predictability (e.g. Ball and Brown 1968; Fama, Fisher, Jensen, and Roll 1969), yet the 1980s-2000s saw an explosion of discovered return predictors (e.g. Rosenberg, Reid, and Lanstein 1985; Campbell and Shiller 1988; Jegadeesh and Titman 1993). Since the 2010s, studies have often found that return predictability has become more elusive, as predictability fails to work out-of-sample (Goyal and Welch 2008), or has been weakened by advances in trading technology and investor learning (Chordia, Subrahmanyam, and Tong 2014; McLean and Pontiff 2016; Martineau 2021).
  

The efficient-market hypothesis (EMH) posits that asset prices reflect all available information, making it challenging to consistently outperform the market on a risk-adjusted basis. This hypothesis has profoundly shaped modern risk-based theories of asset pricing, such as consumption-based and intermediary asset pricing. Empirical research on return predictability has yielded mixed results, with earlier studies often showing a lack of predictability while more recent ones have identified return predictors that later failed out-of-sample or were weakened by advances in trading technology and investor learning. This text delves into the theoretical underpinnings of the EMH, its implications for market anomalies and return predictability, and the ongoing debate surrounding the EMH's validity in the face of empirical evidence.
  

Ein Prompt zum Erstellen eines Titels für einen Artikel ähnelt einem Prompt, der eine kurze Wortgruppe zum Zusammenfassung eines Artikels verwendet. Die folgende Zusammenfassung gibt einen Titel für einen Artikel zurück.


Write a creative title for this text. Give three options.
Text: The efficient-market hypothesis (EMH) is a hypothesis in financial economics that states that asset prices reflect all available information. A direct implication is that it is impossible to 'beat the market' consistently on a risk-adjusted basis since market prices should only react to new information. Because the EMH is formulated in terms of risk adjustment, it only makes testable predictions when coupled with a particular model of risk. As a result, research in financial economics since at least the 1990s has focused on market anomalies, that is, deviations from specific models of risk. The idea that financial market returns are difficult to predict goes back to Bachelier, Mandelbrot, and Samuelson, but is closely associated with Eugene Fama, in part due to his influential 1970 review of the theoretical and empirical research. The EMH provides the basic logic for modern risk-based theories of asset prices, and frameworks such as consumption-based asset pricing and intermediary asset pricing can be thought of as the combination of a model of risk with the EMH. Many decades of empirical research on return predictability has found mixed evidence. Research in the 1950s and 1960s often found a lack of predictability (e.g. Ball and Brown 1968; Fama, Fisher, Jensen, and Roll 1969), yet the 1980s-2000s saw an explosion of discovered return predictors (e.g. Rosenberg, Reid, and Lanstein 1985; Campbell and Shiller 1988; Jegadeesh and Titman 1993). Since the 2010s, studies have often found that return predictability has become more elusive, as predictability fails to work out-of-sample (Goyal and Welch 2008), or has been weakened by advances in trading technology and investor learning (Chordia, Subrahmanyam, and Tong 2014; McLean and Pontiff 2016; Martineau 2021).
  

1. The Efficient Market Hypothesis: Can Market Prices Be Predicted?
2. The EMH and Market Anomalies: A Tale of Predictability and Elusive Returns
3. The Evolution of Market Efficiency: From Bachelier to Fama and Beyond
  

Prompt zur Zusammenfassung des Chats

Im folgenden Prompt wird ein Chat-Log für den Kundensupport zusammengefasst:


Summarize the following conversation.
Service Rep: How may I assist you today?
Customer: I need to change the shipping address for an order.
Service Rep: Ok, I can help you with that if the order has not been fulfilled from our warehouse yet. But if it has already shipped, then you will need to contact the shipping provider. Do you have the order ID?
Customer: Yes, it's 88986367.
Service Rep: One minute please while I pull up your order information.
Customer: No problem
Service Rep: Ok, it looks like your order was shipped from our warehouse 2 days ago. It is now in the hands of the shipping provider, so you will need to contact them to update your delivery details. You can track your order with the shipping provider here: https://www.shippingprovider.com
Customer: Sigh, ok.
Service Rep: Is there anything else I can help you with today?
Customer: No, thanks.
  

A customer called to inquire about changing the shipping address for their order. Unfortunately, their order had already been shipped, so the service representative provided a shipping provider link to the customer to track their order and contact them for any address updates.
  

Prompt zur Zusammenfassung der Hashtag-Tokenisierung

Die Hashtag-Tokenisierung ist eine Form der Zusammenfassung, bei der das Modell Wörter und Wortgruppen aus Text extrahiert, die für den Text als Ganzes repräsentativ sind.

Das folgende Beispiel zeigt einen Prompt, die die Hashtags-Tokenisierung verwendet:


Create some hashtags for this tweet:
Google Cloud
@googlecloud
·
Feb 25
We heard it through the grapevine:
- Document AI Workbench is GA and ready for production use through APIs and the Google Cloud Console
- Deliver higher model accuracy with Workbench
- Build production-ready models faster with Workbench

Read more ↓
  

- #DocumentAIWorkbench
- #GA
- #ProductionReady
- #ModelAccuracy
- #BuildFaster
- #DocumentProcessing
- #DataAnnotation
- #MachineLearning
- #AIPlatform
- #GoogleCloud
  

Extraktions-Prompts

Mit Prompts zur Extraktion können Sie bestimmte Informationen aus Text extrahieren.

Anwendungsfälle

Im Folgenden sind einige gängige Anwendungsfälle für die Extraktion aufgeführt:

  • Benannte Entitätserkennung (NER): Extrahiert benannte Entitäten aus Text, einschließlich Personen, Orten, Organisationen und Datumsangaben.
  • Beziehungsextraktion: Extrahiert die Beziehungen zwischen Entitäten in Text, z. B. Familienbeziehungen zwischen Personen.
  • Ereignisextraktion: Extrahiert Ereignisse aus Text, z. B. Projekt-Meilensteine und Produkteinführungen.
  • Question Answering: Extrahiert Informationen aus Text, um eine Frage zu beantworten.

Best Practices

Versuchen Sie, die Temperatur auf null und Top-K auf eins zu setzen. Extraktionsaufgaben sind in der Regel deterministisch, sodass diese Einstellungen häufig die besten Ergebnisse liefern. Weitere Informationen zu den Parametern temperature und topK finden Sie unter Textparameterdefinitionen.

Beispiele für Extraktionsaufgaben

In den folgenden Beispielen wird gezeigt, wie Sie Prompts für Extraktionen für verschiedene Anwendungsfälle entwerfen.

Extraktion verwenden, um eine Frage zu beantworten

Der folgende Prompt enthält Kontext und eine Frage. Das Modell durchsucht den Kontext nach Informationen, die die Frage beantworten.


Context: There is evidence that there have been significant changes in Amazon rainforest vegetation over the last 21,000 years through the Last Glacial Maximum (LGM) and subsequent deglaciation. Analyses of sediment deposits from Amazon basin paleo lakes and from the Amazon Fan indicate that rainfall in the basin during the LGM was lower than for the present, and this was almost certainly associated with reduced moist tropical vegetation cover in the basin. There is debate, however, over how extensive this reduction was. Some scientists argue that the rainforest was reduced to small, isolated refugia separated by open forest and grassland; other scientists argue that the rainforest remained largely intact but extended less far to the north, south, and east than is seen today. This debate has proved difficult to resolve because the practical limitations of working in the rainforest mean that data sampling is biased away from the center of the Amazon basin, and both explanations are reasonably well supported by the available data.
Q: What does LGM stands for?
A:
  

Last Glacial Maximum
  

Extrahierten Text formatieren

Sie können Informationen aus einer Textquelle extrahieren und in einem strukturierten Format organisieren. Der folgende Prompt formatiert den extrahierten Text als JSON-Datei:


Extract the technical specifications from the text below in a JSON format. Valid fields are name, network, ram, processor, storage, and color.
Text: Google Pixel 7, 5G network, 8GB RAM, Tensor G2 processor, 128GB of storage, Lemongrass
JSON:
  

```
{
"name": "Google Pixel 7",
"network": "5G",
"ram": "8GB",
"processor": "Tensor G2",
"storage": "128GB",
"color": "Lemongrass"
}
```
  

Nächste Schritte