Si fa un gran parlare (e sparlare…) di ChatGPT e delle potenzialità della sua Intelligenza Artificiale.
Ho visto tanti esempi, buoni e cattivi, allarmati o eccitati, di usare questa potentissima tecnologia. Ma quasi tutti erano solo chiacchierate con ChatGPT, oppure poco più.
Ho voluto provare qualcosa in più: usare le API (Application Programming Interface) di ChatGPT spingendo un po’ più in là il confine dell’esplorazione. Visto che sicuramente la capacità di questo LLM (Large Language Model) è tutta sulla linguistica, mi è parso naturale esplorare la possibilità di fargli scrivere un romanzo in autonomia. E, vista la mia passionaccia per la narrativa, ho scelto di provare a fargli usare come “stile di scrittura” il mio.
Beh, to make a long story short: successo pieno! Se volete vedere il risultato, ecco qui il link al PDF: https://bit.ly/PortaDelTempo
Impressionante no? Vi voglio dettagliare i passaggi.
- Ho creato uno script di una sessantina di linee di codice e gli ho passato in input un unico spunto iniziale: “Il protagonista Jon Doe è un pluriassassino ed è stato condannato ad essere proiettato tre secoli nel futuro. Si risveglia nel futuro ma non ha cognizione del suo stato e dovrà ricostruire la sua identità“.
- Con lo script ho fatto generare una quarantina di passaggi della trama del romanzo con un tecnica di “proponi – riassumi – proponi…” in cui non ho dato nessun contributo umano alla generazione del testo.
- Ho usato l’ultimo riassunto ottenuto per far generare (sempre via API) sia il titolo (“La Porta del Tempo: battaglia contro il Signore dei Sogni“) che l’immagine di copertina (quella che trovate in testa all’articolo) e alcune illustrazioni (qui ho usato la API images/generations cioè quella di DALL-E).
Qui il passaggio più complesso: addestrare un modello al mio stile di scrittura. Ho proceduto così:
- Ho raccolto una buona fetta di mia “produzione letteraria” (circa 150.000 parole, cioè 600.000 caratteri) e ho spezzettato il testo in 300 “chunk” da una pagina circa (by the way: codice Python scritto mediante ChatGPT, tanto per gradire).
- Con un altro script ho dato in pasto i trecento prompt a GPT-3 chiedendo di estrarne una sintesi minimale. Ho impacchettato il tutto usando le sintesi come “prompt” e i testi originali come “completion” e ho addestrato in fine-tuning un nuovo modello di GPT-3 (per i curiosi si chiama “davinci:ft-andrea-bonvicini:stileab-2023-01-15-14-50-14“)
- Ho preso il primo spunto del romanzo suggerito da GPT-3 al passo 2 e gli ho fatto generare la prima pagina del romanzo, intitolata “La stanza era vuota“. Beh, vi posso giurare che lo stile collima con il mio in maniera davvero impressionante…
Al termine dell’elaborazione (nota da ricordare: l’unico input umano sono poche righe di testo per lo spunto iniziale) ho tutto direttamente in un documento Word generato in automatico e quel che mi basta è formattarlo con qualche click, impaginare le immagini… et voilà! (ecco qui di nuovo il link al PDF: https://bit.ly/PortaDelTempo)
A questo punto avrei potuto continuare il loop e fargli generare le altre pagine ma mi è bastato, anche perché usare le API di GPT-3 ha un costo. Già, il costo: meno di 35 dollari… di cui la gran fetta (32-33$ dollari circa) per addestrare il modello linguistico.
In buona sostanza, una volta addestrato il modello con il mio personale stile di scrittura, potrei generare romanzi “a manetta” al costo di un paio di dollari l’uno…
Lesson learned, ora:
- la potenza degli strumenti è davvero impressionante;
- per sfruttarla ChatGPT è una bella interfaccia semplice e intuitiva, ma le API possono dare ottime soddisfazioni in termini di automazione e di settaggio fine del risultato;
- se vuoi ottenere testi consistenti è necessario il fine-tuning di un modello;
- fare il fine-tuning è piuttosto semplice (GPT-3 mette a disposizione una serie di strumenti CLI che velocizzano il tutto e non è male l’idea di coinvolgere sempre GPT-3 nel processo di definizione prompt-completion);
- bastano (e probabilmente avanzano) 300 coppie prompt-completion per addestrare il modello.
Ringraziamenti
Spunti di programmazione li ho trovati in due esperti, uno italiano e uno statunitense:
- Alessio Pomaro: https://www.alessiopomaro.it/ https://www.linkedin.com/in/alessiopomaro/
- Dave Shapiro: https://www.davidkshapiro.com/ https://www.linkedin.com/in/dshap-automator/
A loro i miei più sentiti ringraziamenti!
Have you ever thought about optimizing your gaming experience in VALORANT with the best raw accel setting? If not, don’t worry; Adjust your mouse sensitivity to a level that feels comfortable and enables precise aiming. This process is subjective and may require some experimentation to find the perfect sensitivity for your playstyle. For detailed instructions on discovering the best Raw Accel settings in Valorant, you can refer to a relevant post.
Thank you for your sharing. I am worried that I lack creative ideas. It is your article that makes me full of hope. Thank you. But, I have a question, can you help me?
Thank you for great information. Hello Administ . Seo Paketi Skype: By_uMuT@KRaLBenim.Com -_- live:by_umut
Great post thank you. Hello Administ . Seo Paketi Skype: By_uMuT@KRaLBenim.Com -_- live:by_umut
very informative articles or reviews at this time.
You’re so awesome! I don’t believe I have read a single thing like that before. So great to find someone with some original thoughts on this topic. Really.. thank you for starting this up. This website is something that is needed on the internet, someone with a little originality!
For the reason that the admin of this site is working, no uncertainty very quickly it will be renowned, due to its quality contents.
For the reason that the admin of this site is working, no uncertainty very quickly it will be renowned, due to its quality contents.
I appreciate you sharing this blog post. Thanks Again. Cool.
utilisation viagra femme viagra advert music nebenwirkungen sildenafil citrate
Great information shared.. really enjoyed reading this post thank you author for sharing this post .. appreciated
You’re so awesome! I don’t believe I have read a single thing like that before. So great to find someone with some original thoughts on this topic. Really.. thank you for starting this up. This website is something that is needed on the internet, someone with a little originality!
I really like reading through a post that can make men and women think. Also, thank you for allowing me to comment!
very informative articles or reviews at this time.
naturally like your web site however you need to take a look at the spelling on several of your posts. A number of them are rife with spelling problems and I find it very bothersome to tell the truth on the other hand I will surely come again again.
Thank you for great content. Hello Administ. Seo Paketi Skype: By_uMuT@KRaLBenim.Com -_- live:by_umut
Everything is very open and very clear explanation of issues. was truly information.Seo Paketi Skype: By_uMuT@KRaLBenim.Com -_- live:by_umut
Thank you for great information. Hello Administ . Seo Paketi Skype: By_uMuT@KRaLBenim.Com -_- live:by_umut
viagra bnf sildenafil trade names viagra for altitude
This was beautiful Admin. Thank you for your reflections.
Awesome! Its genuinely remarkable post, I have got much clear idea regarding from this post
I really like reading through a post that can make men and women think. Also, thank you for allowing me to comment!
I appreciate you sharing this blog post. Thanks Again. Cool.
naturally like your web site however you need to take a look at the spelling on several of your posts. A number of them are rife with spelling problems and I find it very bothersome to tell the truth on the other hand I will surely come again again.
naturally like your web site however you need to take a look at the spelling on several of your posts. A number of them are rife with spelling problems and I find it very bothersome to tell the truth on the other hand I will surely come again again.
There is definately a lot to find out about this subject. I like all the points you made
I am truly thankful to the owner of this web site who has shared this fantastic piece of writing at at this place.
Thank you for great article. Hello Administ .Seo Paketi Skype: By_uMuT@KRaLBenim.Com -_- live:by_umut
Thank you for your sharing. I am worried that I lack creative ideas. It is your article that makes me full of hope. Thank you. But, I have a question, can you help me?
Nice article inspiring thanks. Hello Administ . Seo Paketi Skype: By_uMuT@KRaLBenim.Com -_- live:by_umut
Hello! I could have sworn I’ve been to this blog before but after browsing through some of the post I realized it’s new to me.Seo Paketi Skype: By_uMuT@KRaLBenim.Com -_- live:by_umut
Привет любители отдыха!
Отлично провести время в уникальном Калининграде возможно благодаря нашей команде частных гидов с автомобилями. Мы предлагаем индивидуальные экскурсии по городу и области, чтобы каждый турист смог насладиться поездкой по своему вкусу. Наши специалисты – аккредитованные экскурсоводы, готовые поделиться знаниями и страстью к этому удивительному региону. Путешествие с нами обещает быть комфортным и увлекательным благодаря нашим комфортабельным автомобилям. Мы заботимся о каждом клиенте, создавая персонализированные маршруты и учитывая все пожелания. Благодаря нашему опыту и профессионализму, каждая экскурсия становится незабываемым приключением. Посетите наш сайт https://topkaliningrad.ru , чтобы узнать больше о наших услугах и забронировать свою экскурсию уже сегодня!
индивидуальные экскурсии в Калининграде
экскурсия по Калининграду индивидуальная
экскурсии Калининграда и Калининградской области
экскурсия в Калининграде индивидуальная
индивидуальный гид Калининград
Калининград экскурсии индивидуальные на машине
Удачи и хорошего визита в Калининград!
You’re so awesome! I don’t believe I have read a single thing like that before. So great to find someone with some original thoughts on this topic. Really.. thank you for starting this up. This website is something that is needed on the internet, someone with a little originality!
You’re so awesome! I don’t believe I have read a single thing like that before. So great to find someone with some original thoughts on this topic. Really.. thank you for starting this up. This website is something that is needed on the internet, someone with a little originality!
Great information shared.. really enjoyed reading this post thank you author for sharing this post .. appreciated
I really like reading through a post that can make men and women think. Also, thank you for allowing me to comment!
I just like the helpful information you provide in your articles
Hi there to all, for the reason that I am genuinely keen of reading this website’s post to be updated on a regular basis. It carries pleasant stuff.
I really love to read such an excellent article. Helpful article. Hello Administ . Seo Paketi Skype: By_uMuT@KRaLBenim.Com -_- live:by_umut
viagra main ingredient walgreens viagra coupon meaning of viagra
I like the efforts you have put in this, regards for all the great content.
Pretty! This has been a really wonderful post. Many thanks for providing these details.
Nice post. I learn something totally new and challenging on websites
I just like the helpful information you provide in your articles
I appreciate you sharing this blog post. Thanks Again. Cool.
Thank you for your sharing. I am worried that I lack creative ideas. It is your article that makes me full of hope. Thank you. But, I have a question, can you help me?
Everything is very open and very clear explanation of issues. was truly information.Seo Paketi Skype: By_uMuT@KRaLBenim.Com -_- live:by_umut
Nice article inspiring thanks. Hello Administ . Seo Paketi Skype: By_uMuT@KRaLBenim.Com -_- live:by_umut
Thank you for content. Area rugs and online home decor store. Hello Administ . Seo Paketi Skype: By_uMuT@KRaLBenim.Com -_- live:by_umut
I really like reading through a post that can make men and women think. Also, thank you for allowing me to comment!