News for hackers. Stuff that matters.

How do I build a chatbot?

Hi guys So I am studying at university and we have this advance AI class in our first master semester and we have to build a chatbot that can answer questions about movies. I never did such a thing before, although I am a capable web developer (3years exp) Where and how do I get started?

I thought about three AI's 1. Intent matching 2. gathering the data 3. answering the question

An API to receive/send messages is already provided. Further data sets that need to be used to answer questions are provided. These include: knowledge graph and several external resources, including a multi-media dataset, pre-trained embeddings, and a crowdsourcing dataset.

In the lecture we learned about SPARQL a query language to query knowledge graphs. Is this of any use? I cannot think of how I would create these queries dynamically based on a user input sentence...

In the end the bot has to be able to answer:

1. factual questions: such as "Who directed bullet train?" (based on knowledge graph) 2. embedding question: "What is the genre of movie x" (based on embedding) 3. Multimedia questions: "show me the picture of leonardo di caprio" (based on multi-media dataset) 4. Recommendation questions: "recommend me a similar movie to james bond" (based on knowledge graph) 5. Crowdsourcing questions: "what is the publication date of jurassic park" (based on crowdsourcing dataset)

Important: We just need to use these datasets to answer the questions, but can use any other available technology such as various libraries or huggingface etc.

How would you go about this task? How can I plug in a natural language question into a knowledge graph an get answers?

TL:DR I need to build a chatbot for uni based on given datasets such as knowledge graph, multimedia dataset, pretrained embeddings etc. How do I start?

Thank you very much

( 3 comments | 3 points | on HN )
Re:How do I build a chatbot? by PaulHoule on Thursday October 06, 2022 @11:41AM (#33109685)
Do you already have a movie database in RDF (with statements like so-and-so directed such-and-such movie) or do you have to make one?

I have done RDF similarity queries with queries similar to

   select ?s2 (count(?s1) as ?cnt) {
       ?s1 ?p ?o .
       ?s2 ?p ?o .
   } group by ?p ?o
where ?s1 is bound to the input movie. That will count the number of shared attributes such as director, actor, year, tagged genre, etc. you can do better if you weight it so po’s that are less common contribute more to the score. Against dbpedia that heuristic does very well for most subjects.
Re:How do I build a chatbot? by sirofjelly on Thursday October 06, 2022 @12:28PM (#33110359)
At the moment I do have a knowledge graph in a .tsv and .nt format.

With lines such as: <http://www.wikidata.org/entity/Q25136425> <http://www.w3.org/2000/01/rdf-schema#label> Ghost Town

Re:How do I build a chatbot? by jd_illa on Thursday October 06, 2022 @12:05PM (#33110037)
Following! Would love to know what you learn and if you are willing to share somewhere.