I am working on NLP project. I have extracted keywords from Resume and stored them in the list. The other list consists of all technical keywords which I have extracted from JSON. Both the lists consist of many keywords and below is just for reference.
list_of_keys=['azure', 'job', 'matlab', 'javascript', 'http', 'android', 'amazon', 'apache spark']
result=['apache http server', 'angularjs', 'azure bot service', 'amazon s3', 'android sdk', 'android studio', 'amazon cloudfront']
Code:
with open('rawtext.json','r', encoding='utf-8') as f:
data = json.load(f)
result = [x["name"].replace("@", " ").lower() for x in data]
print(result)
print ("List of Matched Keywords are:\n")
# Comparing Lists
for item in list_of_keys:
for item1 in result:
if item == item1:
print("Word from Resume: ", item, ", Word from JSON data: ", item1)
print ("****************\n")
Current Output
Word from Resume: box , Word from JSON data: box Word from Resume: arduino , Word from JSON data: arduino Word from Resume: arduino , Word from JSON data: arduino Word from Resume: browser , Word from JSON data: browser Word from Resume: black , Word from JSON data: black Word from Resume: address , Word from JSON data: address Word from Resume: address , Word from JSON data: address
I have tried above a very simple technique by comparing two lists that just matches exact words and prints them. However, what I want is if there is any match in two lists e.g if 'apache spark' gets matched with result list 'apache http server' then it should print as an output: Word from Resume: apache spark, Word from JSON data: apache http server. Similarly, if amazon is matched then it should print as an output: Word from Resume: amazon, Word from JSON data: amazon s3, amazon cloudfront
Required Output:
Word from Resume: apache spark, Word from JSON data: apache http server Word from Resume: amazon, Word from JSON data: amazon s3, amazon cloudfront Word from Resume: http, Word from JSON data: apache http server
Can someone please help me out. Thank you.