Files changed (6) hide show
  1. README.md +8 -2
  2. app.py +40 -0
  3. constraints.txt +43 -0
  4. pyproject.toml +5 -0
  5. requirements-dev.txt +3 -0
  6. requirements.txt +1 -0
README.md CHANGED
@@ -1,5 +1,5 @@
1
  ---
2
- title: Amp
3
  emoji: 🔥
4
  colorFrom: pink
5
  colorTo: pink
@@ -10,4 +10,10 @@ pinned: false
10
  license: unknown
11
  ---
12
 
13
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
1
  ---
2
+ title: マイクロアグレッション判別モデル
3
  emoji: 🔥
4
  colorFrom: pink
5
  colorTo: pink
 
10
  license: unknown
11
  ---
12
 
13
+ # マイクロアグレッション判別モデル
14
+
15
+ ## 技術要件
16
+
17
+ - Python 3.11
18
+ - Streamlit 1.33
19
+
app.py ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import random
2
+
3
+ import streamlit as st
4
+
5
+ ID2CAT = {
6
+ 0: "マイクロアグレッションではない",
7
+ 1: "マイクロアグレッションである",
8
+ }
9
+ explanation_text = """
10
+ このマイクロアグレッションチェッカーは、機械学習(AI技術のようなもの)によって、マイクロアグレッションらしい言語を検出できるように設計されています。
11
+ """
12
+ attention_text = """
13
+ この技術は「文中にマイクロアグレッションに結びつく要素が含まれているかどうか」を判定するモデルになっています。
14
+ 必ずしも「この文章の書き手がマイクロアグレッションをしている」ことを明確に示すものではありません。
15
+
16
+ 判定結果を元に、改めて人間同士で「なぜ/どのようにしてマイクロアグレッションたりうるか」議論をするために利用してください。
17
+ """
18
+
19
+ provide_by = """提供元: オールマイノリティプロジェクト
20
+ [https://all-minorities.com/](https://all-minorities.com/)
21
+ """
22
+
23
+
24
+ st.title("マイクロアグレッション判別モデル")
25
+ st.markdown(explanation_text)
26
+
27
+ user_input = st.text_input("文章を入力してください:", key="user_input")
28
+
29
+
30
+ if st.button("判定"):
31
+ if not user_input:
32
+ st.write("入力が空です。何か入力してください。")
33
+ else:
34
+ st.markdown(attention_text)
35
+ st.divider()
36
+ random_id = random.randint(0, 1)
37
+ st.markdown(f"判定結果: **{ID2CAT[random_id]}**")
38
+ st.divider()
39
+
40
+ st.markdown(provide_by)
constraints.txt ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ altair==5.3.0
2
+ attrs==23.2.0
3
+ blinker==1.7.0
4
+ cachetools==5.3.3
5
+ certifi==2024.2.2
6
+ charset-normalizer==3.3.2
7
+ click==8.1.7
8
+ gitdb==4.0.11
9
+ gitpython==3.1.43
10
+ idna==3.7
11
+ jinja2==3.1.3
12
+ jsonschema==4.21.1
13
+ jsonschema-specifications==2023.12.1
14
+ markdown-it-py==3.0.0
15
+ markupsafe==2.1.5
16
+ mdurl==0.1.2
17
+ mypy==1.9.0
18
+ mypy-extensions==1.0.0
19
+ numpy==1.26.4
20
+ packaging==24.0
21
+ pandas==2.2.2
22
+ pillow==10.3.0
23
+ protobuf==4.25.3
24
+ pyarrow==15.0.2
25
+ pydeck==0.8.0
26
+ pygments==2.17.2
27
+ python-dateutil==2.9.0.post0
28
+ pytz==2024.1
29
+ referencing==0.34.0
30
+ requests==2.31.0
31
+ rich==13.7.1
32
+ rpds-py==0.18.0
33
+ ruff==0.4.0
34
+ six==1.16.0
35
+ smmap==5.0.1
36
+ streamlit==1.33.0
37
+ tenacity==8.2.3
38
+ toml==0.10.2
39
+ toolz==0.12.1
40
+ tornado==6.4
41
+ typing-extensions==4.11.0
42
+ tzdata==2024.1
43
+ urllib3==2.2.1
pyproject.toml ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ [tool.ruff]
2
+ line-length = 120
3
+
4
+ [tool.ruff.lint]
5
+ select = ["E", "F", "I"]
requirements-dev.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ -r requirements.txt
2
+ ruff
3
+ mypy
requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ streamlit