I have the following dataframe:
Sentence
0 Cat is a big lion
1 Dogs are descendants of wolf
2 Elephants are pachyderm
3 Pachyderm animals include rhino, Elephants and hippopotamus
I need to create a python code which looks at the words in sentence above and calculates the sum of scores for each based on following distinct data frame.
Name Score
cat 1
dog 2
wolf 2
lion 3
elephants 5
rhino 4
hippopotamus 5
For example, for row 0, the score will be 1 (cat) + 3 (lion) = 4
I am looking to create an output that looks like following.
Sentence Value
0 Cat is a big lion 4
1 Dogs are descendants of wolf 4
2 Elephants are pachyderm 5
3 Pachyderm animals include rhino, Elephants and hippopotamus 14