1
1
# emosent-py
2
2
3
- emosent-py is a Python utility package to get Sentiment Rankings for Unicode Emojis.
3
+ emosent-py is a Python utility package to get Sentiment Rankings for Unicode Emojis.
4
4
5
5
Based on the research by Kralj Novak P, Smailović J, Sluban B, Mozetič I
6
6
(2015) on _ Sentiment of Emojis_ .
7
7
8
8
Journal Link:
9
- https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0144296
9
+ < https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0144296 >
10
10
11
11
CSV Data acquired from CLARIN repository,
12
- Repository Link: http://hdl.handle.net/11356/1048
12
+ Repository Link: < http://hdl.handle.net/11356/1048 >
13
13
14
14
This project is inspired by [ emoji-sentiment] ( https://github.com/dematerializer/emoji-sentiment ) , a similar utility written in JavaScript.
15
15
16
16
## Emoji Support
17
17
18
- The complete listed of Emojis to Sentiment Ranking supported by this project
19
- can be found at
18
+ The complete listed of Emojis to Sentiment Ranking supported by this project
19
+ can be found at
20
20
[ Emoji Sentiment Ranking v1.0] ( http://kt.ijs.si/data/Emoji_sentiment_ranking/ ) .
21
21
22
22
## Installation
23
23
24
24
You can install emosent-py from using ` pip ` :
25
+
25
26
``` bash
26
27
pip install emosent-py
27
28
```
28
29
29
30
## Usage
30
31
31
- #### Example 1
32
+ ### Example 1
32
33
33
34
``` python
34
35
from emosent import get_emoji_sentiment_rank
35
36
get_emoji_sentiment_rank(' ❤' )
36
37
```
38
+
37
39
Output:
38
- ``` python
40
+
41
+ ``` python
39
42
{' unicode_codepoint' : ' 0x2764' ,
40
43
' occurrences' : 8050 ,
41
44
' position' : 0.746943086 ,
@@ -47,7 +50,7 @@ Output:
47
50
' sentiment_score' : 0.746 }
48
51
```
49
52
50
- #### Example 2
53
+ ### Example 2
51
54
52
55
``` python
53
56
from emosent import get_emoji_sentiment_rank
@@ -56,8 +59,10 @@ from emosent import get_emoji_sentiment_rank
56
59
# mapped to the specified character.
57
60
get_emoji_sentiment_rank(' 😂' )
58
61
```
62
+
59
63
Output:
60
- ``` python
64
+
65
+ ``` python
61
66
{' unicode_codepoint' : ' 0x1f602' ,
62
67
' occurrences' : 14622 ,
63
68
' position' : 0.805100583 ,
@@ -69,7 +74,7 @@ Output:
69
74
' sentiment_score' : 0.221 }
70
75
```
71
76
72
- #### Example 3
77
+ ### Example 3
73
78
74
79
``` python
75
80
from emosent import get_emoji_sentiment_rank_multiple
@@ -78,8 +83,10 @@ from emosent import get_emoji_sentiment_rank_multiple
78
83
# extracts emoji sentiment ranks and their respective positions in the text.
79
84
get_emoji_sentiment_rank_multiple(' well done buddy! 😁👏' )
80
85
```
86
+
81
87
Output:
82
- ``` python
88
+
89
+ ``` python
83
90
# Here, the emojis are found at positions 17 and 18 in the specified text.
84
91
[{' text_position' : 17 ,
85
92
' emoji_sentiment_rank' : {' unicode_codepoint' : ' 0x1f601' ,
@@ -106,11 +113,11 @@ Output:
106
113
107
114
## Versioning
108
115
109
- We use [ SemVer] ( http://semver.org/ ) for versioning. For the versions available,
110
- see the
111
- [ tags on this repository] ( https://github.com/FintelLabs/emosent-py/tags ) .
116
+ We use [ SemVer] ( http://semver.org/ ) for versioning. For the versions available,
117
+ see the
118
+ [ tags on this repository] ( https://github.com/FintelLabs/emosent-py/tags ) .
112
119
113
120
## License
114
121
115
- This project is licensed under the MIT License - see the
122
+ This project is licensed under the MIT License - see the
116
123
[ LICENSE.txt] ( LICENSE.txt ) file for more details.
0 commit comments