Thomas Wolf,他的研究方向包括機(jī)器學(xué)習(xí)、自然語言處理和深度學(xué)習(xí)。在這篇博客中,他介紹了如何利用 Cython
返回上一級(jí)
本文的作者是來自 Hugging face 的科學(xué)家 Thomas Wolf,他的研究方向包括機(jī)器學(xué)習(xí)、自然語言處理和深度學(xué)習(xí)。在這篇博客中,他介紹了如何利用 Cython 和 spaCy 讓 Python 在自然語言處理任務(wù)中獲得百倍加速。雷鋒網(wǎng)(公眾號(hào):雷鋒網(wǎng)) AI 研習(xí)社根據(jù)原文進(jìn)行了編譯。
We can use Slack’s APIs to accomplish this with the following steps:
- Send every message to a serverless endpoint
- Take the text and analyze the sentiment
- Look at historical data and see if things are going poorly
- If things are going bad, send an email to let the administrator know
我想向大家分享我在開發(fā) NeuralCoref v3.0 過程中學(xué)到的一些經(jīng)驗(yàn),尤其將涉及:Text Analytics API from Microsoft’s Cognitive Services. Let’s get started!
百倍加速第一步:代碼剖析
In order to build this demo, you’ll need a few things. First off, you’ll need an account with Webtask. Head over tohttps://webtask.io/make to connect via your favorite social login mechanism. You don’t have to pay a dime. Webtask supports both a CLI and an online editor so you are free to use the one that makes the most sense for you. If you’ve never used Webtask before, you probably want to spend a few minutes in the docs.
Next, you’ll need a Slack account and an organization you can install apps too. Most likely you’re already using Slack but you may not have a place where you have administration rights. When I was testing Slash Webtasks, I created my own Slack organization (raymondcamden.slack.com, and nope, you’re not invited) and it was quick and painless.
Finally, you’ll need to get a key for Microsoft’s Text Analytics API. I’ve got good news/bad news here. First, you can get a free key to test the API. Woot! However, for some reason Microsoft limits your key to 7 days:
That really bugs me. I believe that after the seven days are up you can simply request a new key. And certainly if you are a paying customer this isn’t a problem, but as a developer playing around and testing, it’s a bit annoying to have a time limit like this. As I said, I assume you can simply request new keys later on, but I don’t know for a fact. Complaints aside, you’ll see that the API is easy to use which is a definite plus. For now though, you want to make note of the key.
Creating the Slack App
To begin creating the Slack app, head over to https://api.slack.com, click on “Your Apps” in the upper right hand corner, and you’ll be dropped onto a page listing your current apps. To begin creating a new app, click the “Create New App” button. (I apologize if that’s pretty obvious.)
You’ll be prompted for the name of the app and the workspace:
For app name, let’s go with something simple, like WebtaskCognitiveTest
. For the workspace, select one you have access to and then hit the “Create App” button.
On the next page you can specify various features of your app. For our demo, we care about “Event Subscriptions”: