Spaces:
Running
Running
Commit
•
44dbf52
1
Parent(s):
e7677fd
change color.
Browse filesUpdate app.py
Update app.py
Update app.py
app.py
CHANGED
@@ -79,7 +79,7 @@ def render_metadata():
|
|
79 |
<a href="https://huggingface.co/cis-lmu/glotlid"><img alt="HuggingFace Model" src="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Model-8A2BE2"></a>
|
80 |
<a href="https://github.com/cisnlp/GlotLID"><img alt="GitHub" src="https://img.shields.io/badge/%F0%9F%93%A6%20GitHub-orange"></a>
|
81 |
<a href="https://github.com/cisnlp/GlotLID/blob/main/LICENSE"><img alt="GitHub license" src="https://img.shields.io/github/license/cisnlp/GlotLID?logoColor=blue"></a>
|
82 |
-
<a href="."><img alt="GitHub stars" src="https://img.shields.io/github/stars/cisnlp/GlotLID"></a>
|
83 |
<a href="https://arxiv.org/abs/2310.16248"><img alt="arXiv" src="https://img.shields.io/badge/arXiv-2310.16248-b31b1b.svg"></a>
|
84 |
</p>"""
|
85 |
c = st.container()
|
@@ -126,22 +126,23 @@ model_2 = load_GlotLID_v2(constants.MODEL_NAME, "model_v2.bin")
|
|
126 |
def plot(label, prob):
|
127 |
|
128 |
ORANGE_COLOR = "#FF8000"
|
|
|
129 |
fig, ax = plt.subplots(figsize=(8, 1))
|
130 |
fig.patch.set_facecolor("none")
|
131 |
ax.set_facecolor("none")
|
132 |
|
133 |
-
ax.spines["left"].set_color(
|
134 |
-
ax.spines["bottom"].set_color(
|
135 |
-
ax.tick_params(axis="x", colors=
|
136 |
|
137 |
ax.spines[["right", "top"]].set_visible(False)
|
138 |
|
139 |
ax.barh(y=[0], width=[prob], color=ORANGE_COLOR)
|
140 |
ax.set_xlim(0, 1)
|
141 |
ax.set_ylim(-1, 1)
|
142 |
-
ax.set_title(f"Label: {label}, Language: {get_name(label)}", color=
|
143 |
ax.get_yaxis().set_visible(False)
|
144 |
-
ax.set_xlabel("Confidence", color=
|
145 |
st.pyplot(fig)
|
146 |
|
147 |
def compute(sentences, version = 'v2'):
|
|
|
79 |
<a href="https://huggingface.co/cis-lmu/glotlid"><img alt="HuggingFace Model" src="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Model-8A2BE2"></a>
|
80 |
<a href="https://github.com/cisnlp/GlotLID"><img alt="GitHub" src="https://img.shields.io/badge/%F0%9F%93%A6%20GitHub-orange"></a>
|
81 |
<a href="https://github.com/cisnlp/GlotLID/blob/main/LICENSE"><img alt="GitHub license" src="https://img.shields.io/github/license/cisnlp/GlotLID?logoColor=blue"></a>
|
82 |
+
<a href="https://github.com/cisnlp/GlotLID"><img alt="GitHub stars" src="https://img.shields.io/github/stars/cisnlp/GlotLID"></a>
|
83 |
<a href="https://arxiv.org/abs/2310.16248"><img alt="arXiv" src="https://img.shields.io/badge/arXiv-2310.16248-b31b1b.svg"></a>
|
84 |
</p>"""
|
85 |
c = st.container()
|
|
|
126 |
def plot(label, prob):
|
127 |
|
128 |
ORANGE_COLOR = "#FF8000"
|
129 |
+
BLACK_COLOR = "#31333F"
|
130 |
fig, ax = plt.subplots(figsize=(8, 1))
|
131 |
fig.patch.set_facecolor("none")
|
132 |
ax.set_facecolor("none")
|
133 |
|
134 |
+
ax.spines["left"].set_color(BLACK_COLOR)
|
135 |
+
ax.spines["bottom"].set_color(BLACK_COLOR)
|
136 |
+
ax.tick_params(axis="x", colors=BLACK_COLOR)
|
137 |
|
138 |
ax.spines[["right", "top"]].set_visible(False)
|
139 |
|
140 |
ax.barh(y=[0], width=[prob], color=ORANGE_COLOR)
|
141 |
ax.set_xlim(0, 1)
|
142 |
ax.set_ylim(-1, 1)
|
143 |
+
ax.set_title(f"Label: {label}, Language: {get_name(label)}", color=BLACK_COLOR)
|
144 |
ax.get_yaxis().set_visible(False)
|
145 |
+
ax.set_xlabel("Confidence", color=BLACK_COLOR)
|
146 |
st.pyplot(fig)
|
147 |
|
148 |
def compute(sentences, version = 'v2'):
|