Skip to content

Commit

Permalink
film knowledge
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamster3000 committed Nov 14, 2023
1 parent 6cbf85b commit 5a63856
Show file tree
Hide file tree
Showing 8 changed files with 219 additions and 79 deletions.
13 changes: 10 additions & 3 deletions Joan.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ def process_input(user_input, vectorizer, classifier, er_vectorizer, er_classifi
elif entity == 'year':
tell_year()
elif entity == 'movie release':
user_input = user_input.lower().lstrip().replace('when', '').replace('did', '').replace('release', '')
user_input = user_input.lower().lstrip().replace('when', '').replace('did', '').replace('release', '').replace('released', '').replace('was', '')
movie.collect_data(user_input, movie.release)
elif entity == 'weather monday':
weather_day('monday')
Expand Down Expand Up @@ -613,9 +613,16 @@ def process_input(user_input, vectorizer, classifier, er_vectorizer, er_classifi
elif entity == 'movie writer':
user_input = user_input.replace('who', '').replace('wrote', '').replace('is', '').replace('writer', '').replace('for', '')
movie.collect_data(user_input, movie.writer)
elif entity == 'movie actor':#TODO: Not working.
user_input = user_input.replace('actors', '').replace('acted', '').replace('for', '').replace('who', '').replace('in', '').replace('actor', '')
elif entity == 'movie actor':
user_input = user_input.replace('actors', '').replace('acted', '').replace('for', '').replace('who', '').replace('in', '').replace('actor', '').replace('is', '').replace('the', '')
movie.collect_data(user_input, movie.actor)
elif entity == 'movie plot':
user_input = user_input.replace('what', '').replace('is', '').replace('the', '').replace('plot', '').replace('of', '').rstrip().lstrip().title()
movie.collect_data(user_input, movie.plot)
elif entity == 'languages':
pass
elif entity == 'awards':
pass
else:
chatbot_tools.big_guns(user_input)

Expand Down
3 changes: 2 additions & 1 deletion data/ET.csv
Original file line number Diff line number Diff line change
Expand Up @@ -277,4 +277,5 @@ who directed ,movie director
who wrote ,movie writer
who is the writer for ,movie writer
who acted in ,movie actor
actor for ,movie actor
actor for ,movie actor
what is the plot of ,movie plot
2 changes: 1 addition & 1 deletion data/last time used.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
22/10/2023
14/11/2023
34 changes: 34 additions & 0 deletions data/log.txt
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,37 @@
2023-10-22 08:50:38.077978: Time taken to preprocess data: 4.043442964553833
2023-10-22 08:51:27.402788: All libraries imported. Time taken... 3.0200369358062744
2023-10-22 08:51:27.402788: Time taken to preprocess data: 1.3676633834838867
2023-10-24 09:29:20.388704: All libraries imported. Time taken... 15.690319061279297
2023-10-24 09:29:20.388704: Time taken to preprocess data: 1.413221836090088
2023-10-24 16:12:19.238277: All libraries imported. Time taken... 5.728260517120361
2023-10-24 16:12:19.238277: Time taken to preprocess data: 0.8861391544342041
2023-11-13 13:09:29.412308: All libraries imported. Time taken... 23.60764193534851
2023-11-13 13:09:29.412308: Time taken to preprocess data: 4.728177785873413
2023-11-13 13:12:48.751046: All libraries imported. Time taken... 3.110445261001587
2023-11-13 13:12:48.751046: Time taken to preprocess data: 1.3026080131530762
2023-11-13 14:45:25.591961: All libraries imported. Time taken... 3.014857530593872
2023-11-13 14:45:25.591961: Time taken to preprocess data: 1.3745858669281006
2023-11-13 14:46:12.970297: All libraries imported. Time taken... 2.991736650466919
2023-11-13 14:46:12.970297: Time taken to preprocess data: 1.283196210861206
2023-11-13 14:47:40.253751: All libraries imported. Time taken... 2.8511130809783936
2023-11-13 14:47:40.253751: Time taken to preprocess data: 1.460028886795044
2023-11-13 14:48:14.648207: All libraries imported. Time taken... 2.964568614959717
2023-11-13 14:48:14.648207: Time taken to preprocess data: 1.273550033569336
2023-11-13 14:48:46.696941: All libraries imported. Time taken... 2.8485889434814453
2023-11-13 14:48:46.696941: Time taken to preprocess data: 1.3245408535003662
2023-11-13 14:49:32.768073: All libraries imported. Time taken... 2.9710135459899902
2023-11-13 14:49:32.768073: Time taken to preprocess data: 1.29866623878479
2023-11-13 14:50:30.467662: All libraries imported. Time taken... 3.5328078269958496
2023-11-13 14:50:30.467662: Time taken to preprocess data: 1.3767578601837158
2023-11-13 14:55:04.872208: All libraries imported. Time taken... 3.0198216438293457
2023-11-13 14:55:04.872208: Time taken to preprocess data: 1.2605526447296143
2023-11-13 14:55:45.362623: All libraries imported. Time taken... 2.873882293701172
2023-11-13 14:55:45.362623: Time taken to preprocess data: 1.371633529663086
2023-11-13 14:56:30.688564: All libraries imported. Time taken... 2.8922009468078613
2023-11-13 14:56:30.688564: Time taken to preprocess data: 1.2959380149841309
2023-11-13 14:57:22.715742: All libraries imported. Time taken... 3.7966020107269287
2023-11-13 14:57:22.715742: Time taken to preprocess data: 1.2846026420593262
2023-11-14 08:49:29.593592: All libraries imported. Time taken... 6.704172611236572
2023-11-14 08:49:29.593592: Time taken to preprocess data: 0.8712358474731445
2023-11-14 09:03:17.674251: All libraries imported. Time taken... 3.3468151092529297
2023-11-14 09:03:17.674251: Time taken to preprocess data: 1.3548614978790283
26 changes: 26 additions & 0 deletions data/movie data.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,31 @@
"languages": "English, Turkish",
"awards": "Nominated for 1 Oscar. 72 wins & 67 nominations total",
"rate": "96%"
},
"The Terminator": {
"Year": "26 Oct 1984",
"rated": "R",
"runTime": "107 min",
"genre": "Action, Sci-Fi",
"director": "James Cameron",
"writer": "James Cameron, Gale Anne Hurd, William Wisher",
"actors": "Arnold Schwarzenegger, Linda Hamilton, Michael Biehn",
"plot": "A human soldier is sent from 2029 to 1984 to stop an almost indestructible cyborg killing machine, sent from the same year, which has been programmed to execute a young woman whose unborn son is the key to humanity's future salvat...",
"languages": "English, Spanish",
"awards": "8 wins & 7 nominations",
"rate": "100%"
},
"Terminator 2: Judgment Day": {
"Year": "03 Jul 1991",
"rated": "R",
"runTime": "137 min",
"genre": "Action, Sci-Fi",
"director": "James Cameron",
"writer": "James Cameron, William Wisher",
"actors": "Arnold Schwarzenegger, Linda Hamilton, Edward Furlong",
"plot": "A cyborg, identical to the one who failed to kill Sarah Connor, must now protect her ten year old son John from an even more advanced and powerful cyborg.",
"languages": "English, Spanish",
"awards": "Won 4 Oscars. 38 wins & 33 nominations total",
"rate": "91%"
}
}
2 changes: 1 addition & 1 deletion data/responses.csv
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,4 @@ bot favourite,bot favourite,As a computer I do not have a favourite.,"As a smart
created,created,A student called Jamie Baines created me using the programing language called python.,
gender,gender,"Do not mistake my gender attributes of my female name and female sounding voice, as a smart assistant I do not have a specific gender.","As a smart assistant I do not have a gender, although I am given a female voice and name, I do not have a gender to be specificed by."
version,version,I am version <version>,
user thinking,user thinking,"Youre thinking, Ill be damed if she gets this right.","Until I tell you what I’m thinking, I’m thinking exactly what you’re thinking, and exactly what you’re not thinking at the same time."
user thinking,user thinking,"Youre thinking, Ill be damed if she gets this right.","Until I tell you what I’m thinking, I’m thinking exactly what you’re thinking, and exactly what you’re not thinking at the same time."
2 changes: 1 addition & 1 deletion data/user data.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
index,first name,middle name,surname,dob,nickname,age,gender,interests/hobbies,fix bordem,F-song,F-music genre,F-film,F-book,F-food,disliked food,disabilities,amount of pets,type of pets,name of pets,education,work,visited places,living location,news interest,news hate,city,country,location key
0,Jamie,,,,,,,,,,,,,,,,,,,,,,,,,Sheffield,United Kingdom,326913
0,Jamie,,,,,,,,,,,,,,,,,,,,,,,,,Barnsley,United Kingdom,326913
Loading

0 comments on commit 5a63856

Please sign in to comment.