user.py
def create_authors(corpus):
		"""
		Generate the authors_profile.tsv file
		To perform just ONE time
		:type corpus: pandas.DataFrame
		:return:
		"""

		tpc = TopicsClassifier(pd_corpus=corpus)
		pp = PredictionProfile(pd_corpus=corpus)

		for index, tweet in corpus.iterrows():
			u = User(tweet.User_Name)
			u.load()
			u.update_profile(tweet.Vector, predict=False)
			u.save()

		graph = User.load_graph()
		centralities = nx.eigenvector_centrality(graph)
		for author in User.get_all_authors():
			author.centrality = centralities[author.id] if author.id in centralities else 0.
			author.set_prediction_profile(pp)
			author.set_topic_classifier(tpc)
			author.predict_profile()
			author.save()
		return

		Generate the authors_profile.tsv file
		To perform just ONE time
		:type corpus: pandas.DataFrame
		:return:
		
Generate the authors_profile.tsv file
To perform just ONE time
Generate the authors_profile . tsv file To perform just ONE time
def create_authors(corpus):
		tpc = TopicsClassifier(pd_corpus=corpus)
		pp = PredictionProfile(pd_corpus=corpus)
		for index, tweet in corpus.iterrows():
			u = User(tweet.User_Name)
			u.load()
			u.update_profile(tweet.Vector, predict=False)
			u.save()
		graph = User.load_graph()
		centralities = nx.eigenvector_centrality(graph)
		for author in User.get_all_authors():
			author.centrality = centralities[author.id] if author.id in centralities else 0.
			author.set_prediction_profile(pp)
			author.set_topic_classifier(tpc)
			author.predict_profile()
			author.save()
		return
def create_authors ( corpus ) : tpc = TopicsClassifier ( pd_corpus = corpus ) pp = PredictionProfile ( pd_corpus = corpus ) for index , tweet in corpus . iterrows ( ) : u = User ( tweet . User_Name ) u . load ( ) u . update_profile ( tweet . Vector , predict = False ) u . save ( ) graph = User . load_graph ( ) centralities = nx . eigenvector_centrality ( graph ) for author in User . get_all_authors ( ) : author . centrality = centralities [ author . id ] if author . id in centralities else 0. author . set_prediction_profile ( pp ) author . set_topic_classifier ( tpc ) author . predict_profile ( ) author . save ( ) return
Generate the authors_profile.tsv file
To perform just ONE time
Generate the authors_profile . tsv file To perform just ONE time
"""
		Generate the authors_profile.tsv file
		To perform just ONE time
		:type corpus: pandas.DataFrame
		:return:
		"""
None
corpus