Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to Multiply Custom Weight to TFIDF Value Created by Word Vectors from Tweet Text in Python

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 12
    Answer it

    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)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: