parser.py
def parsing_base_corpus_pandas(corpus_path, separator='\t', categorize=False):
		"""
		Parse the corpus and return a Pandas DataFrame
		:param categorize: boolean to make the tweet and user ids start to 0
		:param separator:
		:param corpus_path: path of the corpus
		:return: pandas.DataFrame
		"""

		df = pd.read_csv(corpus_path, sep=separator, dtype={'User_ID': object})  # , index_col="TweetID"
		df = df.dropna(subset=['User_ID'])  # remove tweets without users

		if categorize:
			df['User_ID_u'] = df.User_ID.astype('category').cat.codes.values
			df['TweetID_u'] = df.TweetID.astype('category').cat.codes.values
			df = df[df.User_ID_u >= 0]

		return df

		Parse the corpus and return a Pandas DataFrame
		:param categorize: boolean to make the tweet and user ids start to 0
		:param separator:
		:param corpus_path: path of the corpus
		:return: pandas.DataFrame
		
Parse the corpus and return a Pandas DataFrame
Parse the corpus and return a Pandas DataFrame
def parsing_base_corpus_pandas(corpus_path, separator='\t', categorize=False):
		df = pd.read_csv(corpus_path, sep=separator, dtype={'User_ID': object})  
		df = df.dropna(subset=['User_ID'])  
		if categorize:
			df['User_ID_u'] = df.User_ID.astype('category').cat.codes.values
			df['TweetID_u'] = df.TweetID.astype('category').cat.codes.values
			df = df[df.User_ID_u >= 0]
		return df
def parsing_base_corpus_pandas ( corpus_path , separator = '\t' , categorize = False ) : df = pd . read_csv ( corpus_path , sep = separator , dtype = { 'User_ID' : object } ) df = df . dropna ( subset = [ 'User_ID' ] ) if categorize : df [ 'User_ID_u' ] = df . User_ID . astype ( 'category' ) . cat . codes . values df [ 'TweetID_u' ] = df . TweetID . astype ( 'category' ) . cat . codes . values df = df [ df . User_ID_u >= 0 ] return df
Parse the corpus and return a Pandas DataFrame
Parse the corpus and return a Pandas DataFrame
"""
		Parse the corpus and return a Pandas DataFrame
		:param categorize: boolean to make the tweet and user ids start to 0
		:param separator:
		:param corpus_path: path of the corpus
		:return: pandas.DataFrame
		""" # , index_col="TweetID" # remove tweets without users
None
corpus_path
path of the corpus
path of the corpus
separator
None
categorize
boolean to make the tweet and user ids start to 0
boolean to make the tweet and user ids start to 0