Skip to content

Commit

Permalink
增加 Docker 版本 username, api_key 參數說明
Browse files Browse the repository at this point in the history
  • Loading branch information
EclairCJ committed May 10, 2021
1 parent dca43b8 commit f697e4f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 20 deletions.
31 changes: 13 additions & 18 deletions Docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,8 @@ <h1 id='KeyMojiAPI'>KeyMojiAPI</h1><h2 id='KeyMoji_1'>KeyMoji</h2>
<p>範例程式:</p>
</blockquote>
<div class="highlight"><pre class="highlight python tab-python"><code><span class="kn">from</span> <span class="nn">KeyMojiAPI</span> <span class="kn">import</span> <span class="n">KeyMoji</span>
<span class="n">keymoji</span> <span class="o">=</span> <span class="n">KeyMoji</span><span class="p">(</span><span class="n">username</span><span class="o">=</span><span class="s">"your_username@mail.com"</span><span class="p">,</span> <span class="n">keymojiKey</span><span class="o">=</span><span class="s">"your_keymoji_key"</span><span class="p">)</span>
<span class="c1"># 若您是使用 Docker 版本,無須填入 username, username 參數
</span><span class="n">keymoji</span> <span class="o">=</span> <span class="n">KeyMoji</span><span class="p">(</span><span class="n">username</span><span class="o">=</span><span class="s">""</span><span class="p">,</span> <span class="n">keymojiKey</span><span class="o">=</span><span class="s">""</span><span class="p">)</span>
</code></pre></div>
<p>初始化 KeyMojiAPI。</p>
<h3>參數說明</h3>
Expand Down Expand Up @@ -859,8 +860,17 @@ <h2 id='KeyMoji_5'>keymoji2visual</h2>
<blockquote>
<p>範例程式:</p>
</blockquote>
<div class="highlight"><pre class="highlight python tab-python"><code><span class="n">keymoji</span><span class="p">.</span><span class="n">keymoji2visual</span><span class="p">(</span><span class="n">sense2Result</span><span class="p">)</span>
</code></pre></div><h3>參數說明</h3>
<div class="highlight"><pre class="highlight python tab-python"><code><span class="n">result</span> <span class="o">=</span> <span class="n">keymoji</span><span class="p">.</span><span class="n">keymoji2visual</span><span class="p">(</span><span class="n">sense2Result</span><span class="p">)</span>
</code></pre></div>
<blockquote>
<p>回傳結果 (JSON 格式):</p>
</blockquote>
<div class="highlight"><pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
</span><span class="nl">"status"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w">
</span><span class="nl">"msg"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Success!"</span><span class="p">,</span><span class="w">
</span><span class="nl">"sense"</span><span class="p">:</span><span class="w"> </span><span class="s2">"sense2"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre></div><h3>參數說明</h3>
<table><thead>
<tr>
<th>參數</th>
Expand Down Expand Up @@ -945,21 +955,6 @@ <h3>回傳內容說明</h3>
<td style="text-align: center">str</td>
<td>此次情緒偵測所使用的功能。</td>
</tr>
<tr>
<td>result</td>
<td style="text-align: center">dict</td>
<td>將繪製的圖表結果存儲至 dict,內容包含以下</td>
</tr>
<tr>
<td></td>
<td style="text-align: center"></td>
<td>- <strong>name</strong>: 圖表的檔案名稱。</td>
</tr>
<tr>
<td></td>
<td style="text-align: center"></td>
<td>- <strong>base64</strong>: Sense2、Tension 為 <code>base64</code> 格式的圖檔。</br>Sense8 為 <code>base64</code> 格式的 .zip 壓縮檔。</td>
</tr>
</tbody></table>
<h3>sense2</h3>
<p><img src="images/sense2-47eb5348.png" title="sense2visual" alt="sense2" /></p>
Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ KeyMoji 關鍵情緒偵測 (**SENSE2、SENSE8、Tension**) 採用不同於其它
```sh
pip3 install KeyMojiAPI
```
or
```sh
python3 -m pip install KeyMojiAPI
```

## 使用方法
[KeyMoji Website Demo](https://api.droidtown.co/#keymoji)
Expand All @@ -17,7 +21,8 @@ pip3 install KeyMojiAPI
### SENSE2
```python
from KeyMojiAPI import KeyMoji
keymoji = KeyMoji(username="your_username@mail.com", keymojiKey="your_keymoji_key")
# 若您是使用 Docker 版本,無須填入 username, keymoji_key 參數
keymoji = KeyMoji(username="", keymojiKey="")

inputSTR = "他逃離了危險的災難"
result = keymoji.sense2(inputSTR)
Expand Down Expand Up @@ -48,7 +53,8 @@ print(result)
### SENSE8
```python
from KeyMojiAPI import KeyMoji
keymoji = KeyMoji(username="your_username@mail.com", keymojiKey="your_keymoji_key")
# 若您是使用 Docker 版本,無須填入 username, keymoji_key 參數
keymoji = KeyMoji(username="", keymojiKey="")

inputSTR = "他逃離了危險的災難"
result = keymoji.sense8(inputSTR)
Expand Down

0 comments on commit f697e4f

Please sign in to comment.