Giter VIP home page Giter VIP logo

emot's Introduction

Downloads GitHub issues GitHub forks GitHub stars GitHub license

Description of the emot:3.1 library

Emot is a python library to extract the emojis and emoticons from a text(string). All the emojis and emoticons are taken from a reliable source details are listed in source section.

Emot 3.1 release moto is: high-performance detection library for data-science specially for large scale datasets of text.

Emot use advance dynamic pattern generation. It means everytime when you create object it generate pattern based on the database(emo_unicode.py). You can add/delete/modify that file under library to create other dynamic pattern.

3.0 version provide more option such as bulk processing. It is useful when you have long list of "sentence or word" and want to use multiprocessing power to speedup the process.

It means you can dynamically create pattern for the emoji or emoticons and run it in multiprocessing to get maximum performance from multiple cores.

Again, I am thankful for all support and help from the community around the world. I hope this will help and make your life easier.

Compatibility

version 3.0 only support python 3.X.

Python 2.X is no longer supported.

Working

The Emot library takes a string/list of string as an input and returns a dictonary.

There are one class name emot containing four different function.

emot.emoji:

  • Input: It has one input: string
  • Output: It will return dictionary with 4 different value: dict
    • value = list of emojis
    • location = list of location list of emojis
    • mean = list of meaning
    • flag = True/False. False means library didn't find anything and True means we find something.

emot.emoticons

  • Input: It has one input: string
  • Output: It will return dictionary with 4 different value: dict
    • value = list of emoticons
    • location = list of location list of emoticons
    • mean = list of meaning
    • flag = True/False. False means library didn't find anything and True means we find something.

emot.bulk_emoji

  • Input: Two input: List of string and CPU cores pool: list[], int
    • By default CPU cores pool value is half of total available cores: multiprocessing.cpu_count()/2
  • Output: It will return list of dictionary with 4 different value: list of dict
    • value = list of emojis
    • location = list of location list of emojis
    • mean = list of meaning
    • flag = True/False. False means library didn't find anything and True means we find something.

emot.bulk_emoticons

  • Input: Two input: List of string and CPU cores pool: list[], int
    • By default CPU cores pool value is half of total available cores: multiprocessing.cpu_count()/2
  • Output: It will return list of dictionary with 4 different value: list of dict
    • value = list of emoticons
    • location = list of location list of emoticons
    • mean = list of meaning
    • flag = True/False. False means library didn't find anything and True means we find something.

Example

>>> import emot 
>>> emot_obj = emot.core.emot() 
>>> text = "I love python โ˜ฎ ๐Ÿ™‚ โค :-) :-( :-)))" 
>>> emot_obj.emoji(text) 
>>> {'value': ['โ˜ฎ', '๐Ÿ™‚', 'โค'], 'location': [[14, 15], [16, 17], [18, 19]], 'mean': [':peace_symbol:', 
':slightly_smiling_face:', ':red_heart:'], 'flag': True} 
>>> emot_obj.emoticons(test) >>> {'value': [':-)', ':-(', ':-)))'], 'location': [[20, 23], [24, 27], [28, 33]], 
'mean': ['Happy face smiley', 'Frown, sad, andry or pouting', 'Very very Happy face or smiley'], 'flag': True} 

Running bulk string emoji and emoticons detection. When user has access multiple processing cores.

>>> import emot 
>>> emot_obj = emot.core.emot() 
>>> bulk_test = ["I love python โ˜ฎ ๐Ÿ™‚ โค :-) :-( :-)))", "I love python 
๐Ÿ™‚ โค :-) :-( :-)))", "I love python โ˜ฎ โค :-) :-( :-)))", "I love python โ˜ฎ ๐Ÿ™‚ :-( :-)))"] 
>>>
>>> emot_obj.bulk_emoji(bulk_test) 
>>> [{'value': ['โ˜ฎ', '๐Ÿ™‚', 'โค'], 'location': [[14, 15], [16, 17], [18, 19]], 
    'mean': [':peace_symbol:', ':slightly_smiling_face:', ':red_heart:'], 'flag': True}, {'value': ['๐Ÿ™‚', 'โค'], 
    'location': [[14, 15], [16, 17]], 'mean': [':slightly_smiling_face:', ':red_heart:'], 'flag': True}, {'value': [
    'โ˜ฎ', 'โค'], 'location': [[14, 15], [16, 17]], 'mean': [':peace_symbol:', ':red_heart:'], 'flag': True}, 
    {'value': ['โ˜ฎ', '๐Ÿ™‚'], 'location': [[14, 15], [16, 17]], 'mean': [':peace_symbol:', ':slightly_smiling_face:'], 
    'flag': True}] 
>>>
>>> emot_obj.bulk_emoticons(bulk_test)
>>> [{'value': [':-)', ':-(', ':-)))'], 'location': [[20, 23], [24, 27], [28, 33]], 'mean': ['Happy face smiley', 
    'Frown, sad, andry or pouting', 'Very very Happy face or smiley'], 'flag': True}, {'value': [':-)', ':-(', ':-)))'], 
    'location': [[18, 21], [22, 25], [26, 31]], 'mean': ['Happy face smiley', 'Frown, sad, andry or pouting', 'Very 
    very Happy face or smiley'], 'flag': True}, {'value': [':-)', ':-(', ':-)))'], 'location': [[18, 21], [22, 25], 
    [26, 31]], 'mean': ['Happy face smiley', 'Frown, sad, andry or pouting', 'Very very Happy face or smiley'], 
    'flag': True}, {'value': [':-(', ':-)))'], 'location': [[18, 21], [22, 27]], 'mean': ['Frown, sad, andry or 
    pouting', 'Very very Happy face or smiley'], 'flag': True}]

Installation

Via pip:

$ pip install emot --upgrade

From master branch:

$ git clone https://github.com/NeelShah18/emot.git
$ cd emot
$ python setup.py install

Developing

$ git clone https://github.com/NeelShah18/emot.git
$ cd emot

Sources

Emoji Cheat Sheet

Official unicode list

official emoticons list

Authors

Neel Shah / @NeelShah18

Shubham Rohilla / @kakashubham

emot's People

Contributors

abhiaj avatar avesh-singh avatar chamathpali avatar neelshah18 avatar oliph avatar shubhamrohilla05 avatar tarikaltuncu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.