Merge branch 'main' into 02_App

pull/244/head
11mLLM 2023-08-01 06:15:48 +09:00 committed by GitHub
commit 1fa74b7368
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 43 additions and 20 deletions

View File

@ -75,7 +75,7 @@ later = today + relativedelta(hours=24)
# The answer formatted with %m/%d/%Y is
today.strftime('%m/%d/%Y')
# Q: Jane thought today is 3/11/2002, but today is in fact Mar 12, which is 1 day later. What is the date 24 hours later in MM/DD/YYYY?
# If Jane thought today is 3/11/2002, but today is in fact Mar 12, then today is 3/1/2002.
# If Jane thought today is 3/11/2002, but today is in fact Mar 12, then today is 3/12/2002.
today = datetime(2002, 3, 12)
# 24 hours later,
later = today + relativedelta(hours=24)
@ -102,4 +102,4 @@ exec(llm_out)
print(born)
```
This will output the following: `02/27/1998`
This will output the following: `02/27/1998`

View File

@ -76,7 +76,7 @@ later = today + relativedelta(hours=24)
# The answer formatted with %m/%d/%Y is
today.strftime('%m/%d/%Y')
# Q: Jane thought today is 3/11/2002, but today is in fact Mar 12, which is 1 day later. What is the date 24 hours later in MM/DD/YYYY?
# If Jane thought today is 3/11/2002, but today is in fact Mar 12, then today is 3/1/2002.
# If Jane thought today is 3/11/2002, but today is in fact Mar 12, then today is 3/12/2002.
today = datetime(2002, 3, 12)
# 24 hours later,
later = today + relativedelta(hours=24)

View File

@ -75,7 +75,7 @@ later = today + relativedelta(hours=24)
# The answer formatted with %m/%d/%Y is
today.strftime('%m/%d/%Y')
# Q: Jane thought today is 3/11/2002, but today is in fact Mar 12, which is 1 day later. What is the date 24 hours later in MM/DD/YYYY?
# If Jane thought today is 3/11/2002, but today is in fact Mar 12, then today is 3/1/2002.
# If Jane thought today is 3/11/2002, but today is in fact Mar 12, then today is 3/12/2002.
today = datetime(2002, 3, 12)
# 24 hours later,
later = today + relativedelta(hours=24)
@ -102,4 +102,4 @@ exec(llm_out)
print(born)
```
Lopputuloksena: `02/27/1998`
Lopputuloksena: `02/27/1998`

View File

@ -75,7 +75,7 @@ later = today + relativedelta(hours=24)
# La réponse formatée avec %m/%d/%Y est
today.strftime('%m/%d/%Y')
# Q: Jane pensait qu'aujourd'hui est le 11/03/2002, mais aujourd'hui est en fait le 12 mars, soit 1 jour plus tard. Quelle est la date 24 heures plus tard en MM/JJ/AAAA ?
# Si Jane pense qu'aujourd'hui est le 11/03/2002, mais qu'aujourd'hui est en fait le 12 mars, alors aujourd'hui est le 01/03/2002.
# Si Jane pense qu'aujourd'hui est le 11/03/2002, mais qu'aujourd'hui est en fait le 12 mars, alors aujourd'hui est le 12/03/2002.
today = datetime(2002, 3, 12)
# 24 heures plus tard,
later = today + relativedelta(hours=24)
@ -102,4 +102,4 @@ exec(llm_out)
print(born)
```
Cela affichera ce qui suit : `27/02/1998`
Cela affichera ce qui suit : `27/02/1998`

View File

@ -75,7 +75,7 @@ later = today + relativedelta(hours=24)
# La risposta formattata come %m/%d/%Y è
today.strftime('%m/%d/%Y')
# D: Jane pensava che oggi fosse il 3/11/2002, ma in realtà è il 12 marzo, cioè un giorno dopo. Qual è la data di 24 ore dopo in MM/DD/YYYY?
# Se Jane pensava che oggi fosse il 3/11/2002, ma in realtà è il 12 marzo, allora oggi è il 3/1/2002.
# Se Jane pensava che oggi fosse il 3/11/2002, ma in realtà è il 12 marzo, allora oggi è il 3/12/2002.
today = datetime(2002, 3, 12)
# 24 hours later,
later = today + relativedelta(hours=24)

View File

@ -75,7 +75,7 @@ later = today + relativedelta(hours=24)
# %m/%d/%Yでフォーマットされた答えは
today.strftime('%m/%d/%Y')
# Q: Janeは今日が2002年3月11日だと思っていましたが、実際は3月12日であり、1日後です。24時間後の日付は何ですかMM/DD/YYYYで答えてください。
# Janeは今日が2002年3月11日だと思っていましたが、実際は3月12日である場合、今日は2002年3月1日です。
# Janeは今日が2002年3月11日だと思っていましたが、実際は3月12日である場合、今日は2002年3月12日です。
today = datetime(2002, 3, 12)
# 24時間後、
later = today + relativedelta(hours=24)
@ -102,4 +102,4 @@ exec(llm_out)
print(born)
```
これにより、`02/27/1998`が出力されます。
これにより、`02/27/1998`が出力されます。

View File

@ -75,7 +75,7 @@ later = today + relativedelta(hours=24)
# A resposta formatada com %m/%d/%Y é
today.strftime('%m/%d/%Y')
# Q: Jane pensou que hoje é 11/03/2002, mas hoje é 12 de março, que é 1 dia depois. Qual é a data 24 horas depois em MM/DD/AAAA?
# Se Jane pensou que hoje é 11/03/2002, mas hoje é 12 de março, então hoje é 01/03/2002.
# Se Jane pensou que hoje é 11/03/2002, mas hoje é 12 de março, então hoje é 12/03/2002.
today = datetime(2002, 3, 12)
# 24 horas depois,
later = today + relativedelta(hours=24)
@ -102,4 +102,4 @@ exec(llm_out)
print(born)
```
Isso produzirá o seguinte: `02/27/1998`
Isso produzirá o seguinte: `02/27/1998`

View File

@ -75,7 +75,7 @@ later = today + relativedelta(hours=24)
# The answer formatted with %m/%d/%Y is
today.strftime('%m/%d/%Y')
# Q: Jane thought today is 3/11/2002, but today is in fact Mar 12, which is 1 day later. What is the date 24 hours later in MM/DD/YYYY?
# If Jane thought today is 3/11/2002, but today is in fact Mar 12, then today is 3/1/2002.
# If Jane thought today is 3/11/2002, but today is in fact Mar 12, then today is 3/12/2002.
today = datetime(2002, 3, 12)
# 24 hours later,
later = today + relativedelta(hours=24)
@ -102,4 +102,4 @@ exec(llm_out)
print(born)
```
Это выведет следующее: `02/27/1998`
Это выведет следующее: `02/27/1998`

View File

@ -76,7 +76,7 @@ later = today + relativedelta(hours=24)
# %m/%d/%Y ile biçimlendirilen yanıt:
today.strftime('%m/%d/%Y')
# S: Jane bugünün 11/3/2002 olduğunu düşündü, ama aslında bugün 12 Mart yani 1 gün sonra. AA/GG/YYYY cinsinden 24 saat sonraki tarih nedir?
# Jane bugünün 11/3/2002 olduğunu düşündüyse ama aslında bugün 12 Mart ise, o zaman bugün 1/3/2002'dir.
# Jane bugünün 11/3/2002 olduğunu düşündüyse ama aslında bugün 12 Mart ise, o zaman bugün 12/3/2002'dir.
today = datetime(2002, 3, 12)
# 24 saat sonra,
later = today + relativedelta(hours=24)
@ -103,4 +103,4 @@ exec(llm_out)
print(born)
```
Aşağıdaki çıktıyı verecektir: `27/02/1998`
Aşağıdaki çıktıyı verecektir: `27/02/1998`

View File

@ -75,7 +75,7 @@ later = today + relativedelta(hours=24)
# The answer formatted with %m/%d/%Y is
today.strftime('%m/%d/%Y')
# Q: Jane thought today is 3/11/2002, but today is in fact Mar 12, which is 1 day later. What is the date 24 hours later in MM/DD/YYYY?
# If Jane thought today is 3/11/2002, but today is in fact Mar 12, then today is 3/1/2002.
# If Jane thought today is 3/11/2002, but today is in fact Mar 12, then today is 3/12/2002.
today = datetime(2002, 3, 12)
# 24 hours later,
later = today + relativedelta(hours=24)
@ -102,4 +102,4 @@ exec(llm_out)
print(born)
```
这将输出以下内容:`02/27/1998`
这将输出以下内容:`02/27/1998`

View File

@ -90,7 +90,7 @@ import openai
openai.ChatCompletion.create(
model="gpt-3.5-turbo",
messages=[
{"role": "system", "content": "res un asistente de investigación de IA. Utilizas un tono técnico y científico."},
{"role": "system", "content": "Eres un asistente de investigación de IA. Utilizas un tono técnico y científico."},
{"role": "user", "content": "Hola, ¿quién eres?"},
{"role": "assistant", "content": "¡Saludos! Soy un asistente de investigación de IA. ¿En qué puedo ayudarte hoy?"},
{"role": "user", "content": "¿Puedes contarme sobre la creación de los agujeros negros?"}

View File

@ -1,3 +1,25 @@
# Retrieval Augmented Generation (RAG)
This page needs a translation! Feel free to contribute a translation by clicking the `Edit this page` button on the right side.
import {Screenshot} from 'components/screenshot'
import RAG from '../../img/rag.png'
I modelli di linguaggio di uso generale possono essere perfezionati per svolgere diversi compiti comuni come l'analisi del sentimento e il riconoscimento delle entità nominate. Questi compiti generalmente non richiedono ulteriori conoscenze di base.
Per compiti più complessi e che richiedono molte conoscenze, è possibile costruire un sistema basato su un modello di linguaggio che accede a fonti di conoscenza esterne per completare i compiti. Questo consente una maggiore coerenza dei fatti, migliora l'affidabilità delle risposte generate e aiuta a mitigare il problema dell'"allucinazione".
I ricercatori di Meta AI hanno introdotto un metodo chiamato [Generazione aumentata dal recupero (RAG)](https://ai.facebook.com/blog/retrieval-augmented-generation-streamlining-the-creation-of-intelligent-natural-language-processing-models/) per affrontare tali compiti che richiedono molte conoscenze. RAG combina un componente di recupero delle informazioni con un modello generatore di testo. RAG può essere perfezionato e la sua conoscenza interna può essere modificata in modo efficiente e senza la necessità di riaddestrare l'intero modello.
RAG prende un input e recupera un insieme di documenti rilevanti/supportativi dati una fonte (ad esempio, Wikipedia). I documenti vengono concatenati come contesto con il prompt di input originale e inviati al generatore di testo che produce l'output finale. Questo rende RAG adattivo per situazioni in cui i fatti potrebbero evolvere nel tempo. Questo è molto utile poiché la conoscenza parametrica dei LLM è statica. RAG consente ai modelli di linguaggio di bypassare la ri-formazione, consentendo l'accesso alle informazioni più recenti per generare output affidabili attraverso la generazione basata sul recupero.
Lewis et al., (2021) hanno proposto una ricetta generale per il perfezionamento di RAG. Un modello seq2seq pre-addestrato viene utilizzato come memoria parametrica e un indice vettoriale denso di Wikipedia viene utilizzato come memoria non parametrica (accessibile tramite un recupero pre-addestrato neurale). Di seguito è riportata una panoramica di come funziona l'approccio:
<Screenshot src={RAG} alt="RAG" />
Fonte dell'immagine: [Lewis et al. (2021)](https://arxiv.org/pdf/2005.11401.pdf)
RAG si comporta in modo forte su diversi benchmark come [Natural Questions](https://ai.google.com/research/NaturalQuestions), [WebQuestions](https://paperswithcode.com/dataset/webquestions), e CuratedTrec. RAG genera risposte che sono più fattuali, specifiche e diverse quando testate su domande MS-MARCO e Jeopardy. RAG migliora anche i risultati sulla verifica dei fatti FEVER.
Questo mostra il potenziale di RAG come opzione valida per migliorare gli output dei modelli di linguaggio nei compiti che richiedono molte conoscenze.
Più recentemente, questi approcci basati su recupero sono diventati più popolari e sono combinati con LLM popolari come ChatGPT per migliorare le capacità e la coerenza fattuale.
Puoi trovare un [esempio semplice di come usare i recuperatori e i LLM per rispondere alle domande con le fonti](https://python.langchain.com/en/latest/modules/chains/index_examples/vector_db_qa_with_sources.html) dalla documentazione di LangChain.

View File

@ -2,6 +2,7 @@
#### (Sorted by Name)
- [AI Test Kitchen](https://aitestkitchen.withgoogle.com)
- [AnySolve](https://www.anysolve.ai)
- [betterprompt](https://github.com/stjordanis/betterprompt)
- [Chainlit](https://github.com/chainlit/chainlit)
- [ChatGPT Prompt Generator](https://huggingface.co/spaces/merve/ChatGPT-prompt-generator)