How to Multiply Custom Weight to TFIDF Value Created by Word Vectors from Tweet Text in Python
Need a lil help with Python coding.
I have a data frame as:
Tweet Text word1 word2 word3 word4
Tweet1 0.23 0 0 0
Tweet2 0 0.45 0 0
Tweet3
The values in the columns word1 word2 word3 word4 are created from TFIDF vectorizer
I want to multiply these values by a custom weight basis the location of the words in the tweet.
Like I will check if word1 is in the first half os Tweet1 then multiply by 0.75 if the word2 is in second half of tweet2 then multiply by 0.25
How do I code this logic in Python.
Any help please??
0 Answer(s)