emoji-express 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,25 @@
1
+ Metadata-Version: 2.4
2
+ Name: emoji-express
3
+ Version: 0.1.0
4
+ Summary: Lightweight Spanish text-to-emoji predictor using Sentence Transformers.
5
+ Author: anndersoon
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: joblib
8
+ Requires-Dist: numpy
9
+ Requires-Dist: huggingface_hub
10
+ Requires-Dist: sentence-transformers
11
+ Requires-Dist: scikit-learn
12
+ Dynamic: author
13
+ Dynamic: description
14
+ Dynamic: description-content-type
15
+ Dynamic: requires-dist
16
+ Dynamic: summary
17
+
18
+ # emoji-express ๐Ÿš€
19
+
20
+ Lightweight Spanish text-to-emoji multi-label predictor using Sentence Transformers and Scikit-learn, hosted on Hugging Face Hub.
21
+
22
+ ## Installation
23
+
24
+ ```bash
25
+ pip install emoji-express
@@ -0,0 +1,8 @@
1
+ # emoji-express ๐Ÿš€
2
+
3
+ Lightweight Spanish text-to-emoji multi-label predictor using Sentence Transformers and Scikit-learn, hosted on Hugging Face Hub.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pip install emoji-express
@@ -0,0 +1,3 @@
1
+ from ..predictor import EmojiPredictor
2
+
3
+ __all__ = ["EmojiPredictor"]
@@ -0,0 +1,30 @@
1
+ import joblib
2
+ import numpy as np
3
+ from huggingface_hub import hf_hub_download
4
+ from sentence_transformers import SentenceTransformer
5
+
6
+ class EmojiPredictor:
7
+ def __init__(self, repo_id: str = "famoso7/emoji-classifier-es", filename: str = "emoji_model_deep.bin"):
8
+ """Descarga e inicializa el modelo desde Hugging Face Hub."""
9
+ print(f"Loading model '{repo_id}'...")
10
+ model_path = hf_hub_download(repo_id=repo_id, filename=filename)
11
+
12
+ artifacts = joblib.load(model_path)
13
+ self.neural_net = artifacts["neural_net"]
14
+ self.mlb = artifacts["mlb"]
15
+ self.embedder = SentenceTransformer(artifacts["embedder_name"])
16
+
17
+ def predict(self, text: str, top_k: int = 2, threshold: float = 0.3) -> str:
18
+ """Predice los emojis mรกs probables para el texto ingresado."""
19
+ text_embedding = self.embedder.encode([text])
20
+ probs = self.neural_net.predict_proba(text_embedding)[0]
21
+
22
+ top_indices = np.argsort(probs)[::-1][:top_k]
23
+ predicted_emojis = [
24
+ self.mlb.classes_[i] for i in top_indices if probs[i] >= threshold
25
+ ]
26
+
27
+ if not predicted_emojis:
28
+ predicted_emojis = [self.mlb.classes_[top_indices[0]]]
29
+
30
+ return " ".join(predicted_emojis)
@@ -0,0 +1,25 @@
1
+ Metadata-Version: 2.4
2
+ Name: emoji-express
3
+ Version: 0.1.0
4
+ Summary: Lightweight Spanish text-to-emoji predictor using Sentence Transformers.
5
+ Author: anndersoon
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: joblib
8
+ Requires-Dist: numpy
9
+ Requires-Dist: huggingface_hub
10
+ Requires-Dist: sentence-transformers
11
+ Requires-Dist: scikit-learn
12
+ Dynamic: author
13
+ Dynamic: description
14
+ Dynamic: description-content-type
15
+ Dynamic: requires-dist
16
+ Dynamic: summary
17
+
18
+ # emoji-express ๐Ÿš€
19
+
20
+ Lightweight Spanish text-to-emoji multi-label predictor using Sentence Transformers and Scikit-learn, hosted on Hugging Face Hub.
21
+
22
+ ## Installation
23
+
24
+ ```bash
25
+ pip install emoji-express
@@ -0,0 +1,9 @@
1
+ README.md
2
+ setup.py
3
+ emoji_express/__init__.py
4
+ emoji_express/predictor.py
5
+ emoji_express.egg-info/PKG-INFO
6
+ emoji_express.egg-info/SOURCES.txt
7
+ emoji_express.egg-info/dependency_links.txt
8
+ emoji_express.egg-info/requires.txt
9
+ emoji_express.egg-info/top_level.txt
@@ -0,0 +1,5 @@
1
+ joblib
2
+ numpy
3
+ huggingface_hub
4
+ sentence-transformers
5
+ scikit-learn
@@ -0,0 +1 @@
1
+ emoji_express
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,18 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ setup(
4
+ name="emoji-express",
5
+ version="0.1.0",
6
+ packages=find_packages(),
7
+ install_requires=[
8
+ "joblib",
9
+ "numpy",
10
+ "huggingface_hub",
11
+ "sentence-transformers",
12
+ "scikit-learn"
13
+ ],
14
+ author="anndersoon",
15
+ description="Lightweight Spanish text-to-emoji predictor using Sentence Transformers.",
16
+ long_description=open("README.md", encoding="utf-8").read(),
17
+ long_description_content_type="text/markdown",
18
+ )