В столбце заголовка есть такие ключевые слова, как собака, вы должны выполнить поиск в той же строке в столбце под названием «Текст», затем создать новый столбец с именем предложение и написать фразу, в которой было найдено это слово.
import pandas as pd
PAL = {'TITLE': ['CAT','DOG','MOUSE','BIRD'],
'TEXT': ["""
I like small dogs.
I do not like cats. Birds fly through the sky.
A mouse eat cheese and they are small""","""
I like small dogs.
I do not like cats.
Birds fly through the sky. A mouse eat cheese and they are small""","""
I like small dogs.
I do not like cats. Birds fly through the sky.
A mouse eat cheese and they are small""","""
I like small dogs.
I do not like cats. Birds fly through the sky.
A mouse eat cheese and they are small"""]
}
df = pd.DataFrame(PAL, columns = ['TITLE', 'TEXT'])
print (df)

import pandas as pd
PAL = {'TITLE': ['CAT','DOG','MOUSE','BIRD'],
'TEXT': ["""
I like small dogs.
I do not like cats. Birds fly through the sky.
A mouse eat cheese and they are small""","""
I like small dogs.
I do not like cats.
Birds fly through the sky. A mouse eat cheese and they are small""","""
I like small dogs.
I do not like cats. Birds fly through the sky.
A mouse eat cheese and they are small""","""
I like small dogs.
I do not like cats. Birds fly through the sky.
A mouse eat cheese and they are small"""],
'SENTENCE':["I do not like cats","I like small dogs","A mouse eat cheese and they are small","Birds fly through the sky"] }
df = pd.DataFrame(PAL, columns = ['TITLE', 'TEXT','SENTENCE'])
print (df)
