I am trying to clean my sentences and what I want to remove these tags in my sentences (They are in the form of underscore followed by a word eg "_UH"). Basically I want to remove the string followed by an underscore (also removing the underscore itself)
text:
['hanks_NNS sir_VBP',
'Oh_UH thanks_NNS to_TO remember_VB']
Output Required:
['hanks sir',
'Oh thanks to remember']
Following is the code I tried:
for i in text:
k= i.split(" ")
print (k)
for z in k:
if "_" in z:
j=z.replace("_",'')
print (j)
Current Output:
ThanksNNS
sirVBP
OhUH
thanksNNS
toTO
rememberVB
RemindVB