xl = pd.ExcelFile("Entity.xlsx")
Checking the sheets in the excel
Saving the sheet in to the Data Frame
r=df["Region"]
r.dropna(inplace=True)
Setting key value for the data set
rv="region"
d1={l:rv for l in r }
removing the extra spaces in the sentence
sentence = ' hello apple hjdfs ads'
a=" ".join(sentence.split())
Pickiling the Dictionaries
import pickle
f = open("enlist.pkl","wb")
pickle.dump(d2,f)
f.close()
Un-Pickiling the Dictionaries
e=pickle.load(open("enlist.pkl","rb"))
print(e['Display'])
removing spaces before wwords
proper_entity=[[l[0].strip()]for l in proper_entity]
def clean_sentence(sent):
text = str(sent)
text = text.replace('/', " / ")
text = text.replace('-', ' - ')
text = text.replace('&', ' & ')
text = text.replace('?', " ?")
text = text.replace(',', " , ")
text = text.replace('\t', " ")
text = text.replace('\n', " ")
text = text.replace('$', " $ ")
return text