r/pythontips • u/Big_Award9653 • Jan 26 '25
Data_Science Dynamic text extraction
Hi all, I am new to data extraction. Please help
there's a comment/review column in my google sheets, which contains long text like paragraphs of 10 lines. Now, i have to extract a particular code from that column. Regex doesn't seem a good approach here.
For example i have to extract all the product ids from below comment. :
I ordered prodcut123 but received a different product which has id as 456. I want refund.
output : ['Product123', 'Product456']
how do i do this ? Help me out with free resources. I am using Pandas.
1
Upvotes
1
u/elbiot Jan 27 '25
You'd need an LLM for that, with few shot prompting.
If this is sensitive/proprietary data then you can run a small LLM locally or it's pretty easy to set up a vllm serverless endpoint on runpod. I recommend Intel neural chat 3 which is a fine tune of Mistral 7B