Reddit Sentiment Analysis Y4 v3.0.0
Loading...
Searching...
No Matches
Classes | Functions | Variables
app Namespace Reference

Classes

class  SearchHistory
 

Functions

 get_utc_plus_one ()
 
 fetch_comments_from_posts (search_term, subreddit='all', sort_order='default', time_filter='all', comment_sort_order='top', max_comments=1000, max_comments_per_post=75)
 
 preprocess_text (text)
 
 predict_sentiment (text)
 
 interpret_sentiment (positive_percentage)
 
 convert_to_html_list (text)
 
 prepare_comments_for_gpt (comments, max_tokens=16385, prompt_type='default')
 
 chatgpt_sentiment_analysis (comments, prompt_type)
 
 save_sentiment_pie_chart (positive_percentage, image_path)
 
 save_word_cloud (comments, image_path)
 
 fetch_comments (search_term, subreddit='all', limit=5)
 
 home ()
 
 generate_prompt ()
 
 validate_search_term ()
 
 landing ()
 
 history ()
 

Variables

 app = Flask(__name__)
 
 secret_key
 
 db = SQLAlchemy(app)
 
 reddit
 
 model = DistilBertForSequenceClassification.from_pretrained('C:\\Users\\35387\\Desktop\\app1\\distilbert_sentiment_analysis')
 
 tokenizer = DistilBertTokenizerFast.from_pretrained('C:\\Users\\35387\\Desktop\\app1\\distilbert_sentiment_analysis_tokenizer')
 
 debug
 

Function Documentation

◆ chatgpt_sentiment_analysis()

app.chatgpt_sentiment_analysis ( comments,
prompt_type )

Definition at line 234 of file app.py.

◆ convert_to_html_list()

app.convert_to_html_list ( text)

Definition at line 142 of file app.py.

◆ fetch_comments()

app.fetch_comments ( search_term,
subreddit = 'all',
limit = 5 )

Definition at line 299 of file app.py.

◆ fetch_comments_from_posts()

app.fetch_comments_from_posts ( search_term,
subreddit = 'all',
sort_order = 'default',
time_filter = 'all',
comment_sort_order = 'top',
max_comments = 1000,
max_comments_per_post = 75 )

Definition at line 75 of file app.py.

◆ generate_prompt()

app.generate_prompt ( )

Definition at line 388 of file app.py.

◆ get_utc_plus_one()

app.get_utc_plus_one ( )

Definition at line 41 of file app.py.

◆ history()

app.history ( )

Definition at line 433 of file app.py.

◆ home()

app.home ( )

Definition at line 320 of file app.py.

◆ interpret_sentiment()

app.interpret_sentiment ( positive_percentage)

Definition at line 125 of file app.py.

◆ landing()

app.landing ( )

Definition at line 429 of file app.py.

◆ predict_sentiment()

app.predict_sentiment ( text)

Definition at line 118 of file app.py.

◆ prepare_comments_for_gpt()

app.prepare_comments_for_gpt ( comments,
max_tokens = 16385,
prompt_type = 'default' )

Definition at line 181 of file app.py.

◆ preprocess_text()

app.preprocess_text ( text)

Definition at line 105 of file app.py.

◆ save_sentiment_pie_chart()

app.save_sentiment_pie_chart ( positive_percentage,
image_path )

Definition at line 278 of file app.py.

◆ save_word_cloud()

app.save_word_cloud ( comments,
image_path )

Definition at line 289 of file app.py.

◆ validate_search_term()

app.validate_search_term ( )

Definition at line 419 of file app.py.

Variable Documentation

◆ app

app.app = Flask(__name__)

Definition at line 32 of file app.py.

◆ db

app.db = SQLAlchemy(app)

Definition at line 38 of file app.py.

◆ debug

app.debug

Definition at line 463 of file app.py.

◆ model

app.model = DistilBertForSequenceClassification.from_pretrained('C:\\Users\\35387\\Desktop\\app1\\distilbert_sentiment_analysis')

Definition at line 71 of file app.py.

◆ reddit

app.reddit
Initial value:
1= praw.Reddit(client_id='',
2 client_secret='',
3 user_agent='')

Definition at line 66 of file app.py.

◆ secret_key

app.secret_key

Definition at line 33 of file app.py.

◆ tokenizer

app.tokenizer = DistilBertTokenizerFast.from_pretrained('C:\\Users\\35387\\Desktop\\app1\\distilbert_sentiment_analysis_tokenizer')

Definition at line 72 of file app.py.