lemmatizing a verb list in a data frame

I want to ask a seemingly simple question to programming wizs (I am a total newbie so have no idea how simple/complex this question is)!

I have a verb list in a data frame looking as below:

id verb
15 believe
64 start
90 believe

I want to lemmatize it. The problem is that most lemmatization comes with sentence strings. My data does not provide context to decide its part-of-speech because I only need 'verb' speech lemmas.

Would you have any ideas about how to go about lemmatizing this verb list? Many thanks in advance for considering my question!

what are you hoping the result will look like for your given example ?

Hi Nir,

Many thanks for considering my question :slight_smile:
I am a total newbie and was switching from R to Python and kind of did lemmatisation in Python. And somehow, the output in csv file format does not seem right in R, so I seem to have to finish my job in Python.

If you have time, would you please read below and help me with further analysis? I appreciate any help you can provide.

I want to count a list of verbs in each row of the lemmatised texts in a data frame in Python. I need to use the for-loop or other iterating function to do the counting and create a frequency table of 40 columns (39 verbs + filename) and 326 rows (text strings). The data frame looks like the below screenshot:

And the code I have managed to write so far is as below:

import pandas as pd
import numpy as np

df = pd.read_csv('texts.csv')
lemma = df['lemma']

verbs = pd.verbs_csv('verbs.csv)
word = verbs['verbs']

import re
count = sum(1 for _ in re.finditer(r'\b%s\b' % re.escape(word), lemma))

The code above does not work :sweat_smile:
First, I need to concatenate the 39 lemmas and 326 strings, respectively. In addition, I need a for-loop to iterate the counting of each verb in each row.
Would it be OK to ask you about this, even if it is Python programming? Thanks again!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.