**Suppose i have this random words of Paragraphs as a list:**

```
t = ['protein and carbohydrates Its is a little heavier pulsus widely used and is a versatile ingredient',
 'Tea contains the goodness of  Natural Ingredients Cardamom Ginger Tea bags Disclaimers As per Ayurvedic texts',
 'almonds are all natural supreme sized nuts they are highly nutritious and extremely healthy',
 'Camel milk can be consumed by lactose intolerant people and those allergic to cows milk',
 'Healthy Crunch  Almond with honey is an extra crunchy breakfast cereal for a delightful start to your mornings']

```

**Dictionary as**

```
d = {'First': ['Tea','Coffee'],
     'Second':  ['Noodles','Pasta'],
     'Third': ['sandwich','honey'],
     'Fourth': ['Almond','apricot','blueberry']
    }

```

**The Code i Have written is very slow and also i want to display 'NA' for the Paragraphs that does'nt matched to any text**

**CODE**

```
get_labels = []
get_text = []

for txt in t:
    for dictrow in d.values():
        for i in dictrow:
            for j in txt.split():
                if i == j:
                    print(j)
                    print(txt)
                    get_labels.append(j)
                    get_text.append(txt)

pd.DataFrame(list(zip(get_text,get_labels)),columns=["whole_text","matched_text"])

```

**Finally after creating the Dataframe Output is:**

```
     whole_text                                       matched_text
0   Tea contains the goodness of Natural Ingredie...    Tea
1   Tea contains the goodness of Natural Ingredie...    Tea
2   Healthy Crunch Almond with honey is an extra ...    honey
3   Healthy Crunch Almond with honey is an extra ...    Almond

```

**But the Output i want is:**

```
     whole_text                                       matched_text
0   protein and carbohydrates Its is a little ....      NA 
1   Tea contains the goodness of Natural Ingredie...    Tea
2   Tea contains the goodness of Natural Ingredie...    Tea
3   almonds are all natural supreme sized nuts th...    NA
4   Camel milk can be consumed by lactose intoler...    NA
2   Healthy Crunch Almond with honey is an extra ...    honey
3   Healthy Crunch Almond with honey is an extra ...    Almond

```

I have 2 Issues:  

a) I want to add 'NA' for the paragraph that doesn't matched to any text dictionary values like above table.  

b) How do i optimize this code to run it faster because i am using it on large dataset