original_docstring: Computes TFIDF for a corpus of user tweets.  TF is computed from
          concatinated tweets.  IDF is computed in conjunction with an optional
          corpus of non-user tweets (depends on use_contxt value in constuctor). 
          
          Args:
          user_tweet_corpus (np.array): Array of text tweets by the user to model
          context_tweet_corpus (np.array): Optional array non-user tweets for
              common word normalization.  If none, skip the IDF (default:none).
          
docstring: Computes TFIDF for a corpus of user tweets.  TF is computed from
  concatinated tweets.  IDF is computed in conjunction with an optional
  corpus of non-user tweets (depends on use_contxt value in constuctor).
  
  user_tweet_corpus (np.array): Array of text tweets by the user to model
  context_tweet_corpus (np.array): Optional array non-user tweets for
  common word normalization.  If none, skip the IDF (default:none).
docstring_tokens: Computes TFIDF for a corpus of user tweets . TF is computed from concatinated tweets . IDF is computed in conjunction with an optional corpus of non - user tweets ( depends on use_contxt value in constuctor ) . user_tweet_corpus ( np . array ) : Array of text tweets by the user to model context_tweet_corpus ( np . array ) : Optional array non - user tweets for common word normalization . If none skip the IDF ( default : none ) .
code: def characterize(self, corpus, context_corpus):
          """Computes TFIDF for a corpus of user tweets.  TF is computed from
          concatinated tweets.  IDF is computed in conjunction with an optional
          corpus of non-user tweets (depends on use_contxt value in constuctor). 
          
          Args:
          user_tweet_corpus (np.array): Array of text tweets by the user to model
          context_tweet_corpus (np.array): Optional array non-user tweets for
              common word normalization.  If none, skip the IDF (default:none).
          """
          if self.use_context:  # provided context vector to support IDF
              tfidf_vectorizer = TfidfVectorizer(stop_words='english',
                                                         use_idf=True)
              self.word_freq_vec = tfidf_vectorizer.fit_transform(
                  [' '.join(corpus),
                   ' '.join(corpus)+' '.join(context_corpus)]
                   ).toarray()[0]
          
          else: # No context, just term frequency
              tfidf_vectorizer = TfidfVectorizer(stop_words='english',
                                                 use_idf=False)
              self.word_freq_vec = tfidf_vectorizer.fit_transform(
                                  [' '.join(corpus)]).toarray()[0]
      
          self.feature_names = tfidf_vectorizer.get_feature_names()
code_tokens: def characterize ( self , corpus , context_corpus ) : if self . use_context : tfidf_vectorizer = TfidfVectorizer ( stop_words = 'english' , use_idf = True ) self . word_freq_vec = tfidf_vectorizer . fit_transform ( [ ' ' . join ( corpus ) , ' ' . join ( corpus ) + ' ' . join ( context_corpus ) ] ) . toarray ( ) [ 0 ] else : tfidf_vectorizer = TfidfVectorizer ( stop_words = 'english' , use_idf = False ) self . word_freq_vec = tfidf_vectorizer . fit_transform ( [ ' ' . join ( corpus ) ] ) . toarray ( ) [ 0 ] self . feature_names = tfidf_vectorizer . get_feature_names ( )
short_docstring: Computes TFIDF for a corpus of user tweets.
short_docstring_tokens: Computes TFIDF for a corpus of user tweets .
comment: """Computes TFIDF for a corpus of user tweets.  TF is computed from
          concatinated tweets.  IDF is computed in conjunction with an optional
          corpus of non-user tweets (depends on use_contxt value in constuctor). 
          
          Args:
          user_tweet_corpus (np.array): Array of text tweets by the user to model
          context_tweet_corpus (np.array): Optional array non-user tweets for
              common word normalization.  If none, skip the IDF (default:none).
          """$SEP$# provided context vector to support IDF$SEP$# No context, just term frequency