mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-27 19:53:17 +00:00
* Started auto doc generation * Created a markdown document * Added test changed to md * Created working version of new documentation * Made requested changes * Generate docs for all Co-authored-by: minhhoang1023 <40023817+minhhoang1023@users.noreply.github.com>
1.2 KiB
Vendored
1.2 KiB
Vendored
common.behavioural_analysis.sentiment
To obtain charts, make sure to add chart=True as the last parameter
Get underlying data
###common.behavioural_analysis.sentiment(post_data: List[str]) -> float
Find the sentiment of a post and related comments
Parameters
----------
post_data: List[str]
A post and its comments in string form
Returns
-------
float
A number in the range [-1, 1] representing sentiment
Getting charts
###common.behavioural_analysis.sentiment(symbol: str, n_tweets: int = 15, n_days_past: int = 2, compare: bool = False, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True)
Plot sentiments from symbol
Parameters
----------
symbol: str
Stock ticker symbol to get sentiment for
n_tweets: int
Number of tweets to get per hour
n_days_past: int
Number of days to extract tweets for
compare: bool
Show corresponding change in stock price
export: str
Format to export tweet dataframe
external_axes: Optional[List[plt.Axes]], optional
External axes (1 axis is expected in the list), by default None