Google은 흑인 공동체를 위한 인종적 평등을 추구하기 위해 노력하고 있습니다. 자세히 알아보기

Analyze Toxicity with Perspective API

Jigsaw
Made by Jigsaw

Analyze the perceived impact a comment might have on a conversation using Perspective API.

이 확장 프로그램의 작동 방식

Use this extension to get toxicity scores from Perspective API for comments written to a Cloud Firestore collection.

This extension runs Perspective API on the text field and collection you configure. The API uses machine learning models to score the perceived impact a comment might have on a conversation by evaluating that comment across a range of emotional concepts, called attributes. When you install this extension, you will specify the attributes you want to receive scores for. Perspective's main attribute is TOXICITY, defined as "a rude, disrespectful, or unreasonable comment that is likely to make you leave a discussion". See a list of all available attributes on our developer site. Scores are retrieved when a new document is added to your collection or an existing document is modified.

Additional setup

Before you can use this extension, you will need to enable Perspective API. Follow the instructions on our Get Started page to request API access and then enable the API and create an API key.

By default, you're granted quota for 1 query per second (QPS) to Perspective API. For additional QPS, fill out a quota increase request as needed.

Note: If you add or update documents at a rate higher than your allotted QPS, you may exceed quota and the extension will fail to score your documents.

Billing

Perspective API is no-cost for all amounts of quota. However, the extension uses Firebase and Google Cloud Platform services which may have associated charges, including:

  • Cloud Firestore
  • Cloud Functions

When you use Firebase Extensions, you're only charged for the underlying resources that you use. A paid-tier billing plan is only required if the extension uses a service that requires a paid-tier plan, for example calling to a Google Cloud API or making outbound network requests to non-Google services. All Firebase services offer a no-cost tier of usage. Learn more about Firebase billing.

확장 프로그램 설치 방법

Firebase Console 사용

Firebase Console을 사용해 확장 프로그램을 설치하고 관리할 수 있습니다.

Console을 사용해 설치하기

Firebase CLI 사용

Firebase CLI를 사용해 확장 프로그램을 설치하고 관리할 수도 있습니다.

1단계: 다음 npm 명령어를 실행하여 CLI를 설치하거나 최신 CLI 버전으로 업데이트합니다.

npm install -g firebase-tools
작동하지 않는 경우 Firebase CLI 참조를 살펴보거나 npm 권한을 변경하세요.

2단계: 새 Firebase 프로젝트 디렉터리를 설정하거나 기존 디렉터리로 이동합니다.

3단계: 다음을 실행하여 이 확장 프로그램을 확장 프로그램 매니페스트에 추가합니다.

firebase ext:install jigsaw/firestore-perspective-toxicity --local --project=projectId_or_alias

4단계(선택사항): Firebase 에뮬레이터 도구 모음으로 이 확장 프로그램을 로컬에서 테스트합니다.

firebase emulators:start

5단계: 매니페스트의 확장 프로그램을 프로젝트에 배포합니다.

firebase deploy --only extensions --project=projectId_or_alias
지원
Cloud Firestore
작성자
라이선스
Apache-2.0
버전
0.1.5