|
|
|
|
|
by psyklic
821 days ago
|
|
Building a prototype of this would be very straightforward. The difficulty would be ensuring high-quality results. 1. You'd only have to know basic web dev. Enough to get input from the user, send it to an API (e.g. https://openai.com/blog/openai-api), and display results. There are many tutorials online showing how to do this. 2. You'd then design a prompt ("prompt engineering") that tells the GPT it's read the book, asking it to converse in a friendly manner as an expert literary critic, etc. Place this prompt and the prior conversation before the user's new question. Then send it to the API. (It's likely the GPT at least knows something about most popular books.) 3. You can now try to improve the results. A popular method: If you have the full text for the book, you can do a text search for the user's query. Then just include relevant parts of the book in the prompt. |
|
I am imagine something more complicated, like having a chatbot with the personality of the character in the book answering hypothetical questions. Like asking gandolf why he didn't send the eagles to drop the ring!!!! Or asking dumbledledore why don't he create horcrux himself and fight voldemore, since he was able to defeat him once at the ministry of magic.
So here is kind of my understanding of pre gpt3 like models like BERT
1. Bert or any sentence transformer models generate embedding on the entire book (search space)
2. You pipe in your query to the same model generate embedding (query)
3. you do ANN or bruteforce KNN (lsh, pq) on top of the search space embedding with your query, essentially finding dot product with lowest value
What I am having trouble understanding is using sentence transformer does not give you answer using the character of the book, but LLM does.
How do I build a chat app that do that? Do I just use openai api? Or can I train my own llm or use off the shelf llm like llama?