commit b0505cdd1102cc2fdc4c3f1191d3106cfcc9f005 Author: David Lawler Date: Tue Mar 1 08:56:24 2022 +1000 first diff --git a/main.py b/main.py new file mode 100644 index 0000000..0d2630f --- /dev/null +++ b/main.py @@ -0,0 +1,19 @@ +import json +#print("Hello, I am a question answering bot.\n") +#Question = str(input("Please enter a question, and press the ENTER key:\n")) +#print ("I think that you asked " + (Question)) + +#def jaccard_similarity(list1, list2): + # s1 = set(list1) + # s2 = set(list2) + # return float(len(s1.intersection(s2)) / len(s1.union(s2))) +#list1 = ['dog', 'cat', 'cat', 'rat'] +#list2 = ['dog', 'cat', 'mouse'] +#jaccard_similarity(list1, list2) + + +with open('questionbank.json', 'r') as f: + questionBank = json.load(f) + +# Output: {'name': 'Bob', 'languages': ['English', 'French']} +print(questionBank) \ No newline at end of file diff --git a/questionBank.json b/questionBank.json new file mode 100644 index 0000000..6111985 --- /dev/null +++ b/questionBank.json @@ -0,0 +1,10 @@ +[ + { + "question": "What day is today?", + "answer": "Monday" + }, + { + "question": "What is the weather like today?", + "answer": "Same as yesterday." + } + ] \ No newline at end of file