- Notifications
You must be signed in to change notification settings - Fork0
henni99/WebChatbotAPI
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Dialogflow와 web nodejs 연동법
KoGPT-2와 web nodejs 연동법
이 토닥토닥 프로젝트는 불안 장애를 막기 위해 개발된 웹 기반 API입니다.불안 정도 검사, 불안 원인 검사, 딥러닝 기반 챗봇과의 자유로운 대화를 통해 불안한 감정을 확인하고 치유할 수 있습니다.
- Dialog flow를 통해 정해진 질의 응답을 작성 (WIKI 참조)
- Dialog flow API를 사용하기 위해서 Google Cloud Platform에서 해당 Dialogflow project 찾은 후에 인증 키 발급 (https://github.com/googleapis/nodejs-dialogflow 참조)
- Json 파일 발급 후 public 파일 안에 넣어줍니다. (Chatbot 파일과 같은 위치에)
- 라이브러리 설치 (해당 디렉토리(Chatbot) 경로 변경 후 설치)
npminit
npmIdialogflow
npminstalluuidexpressbody-parser
- 아래 해당 주석 위치에 내용 추가
varserviceAccount=require("")// firebase json file positionadmin.initializeApp({credential:admin.credential.cert(serviceAccount),databaseURL:""// firebase database url});
- child 내부에 자신의 firebase uid 추가
db.ref('anxiety information').child('').push().set(newContact2);//myUiddb.ref('anxietyinformationforreport').child('').set(newContact2);//myuid
- 아래 function의 주석 위치에 정보 추가
asyncfunctionrunSample(msg,projectId= '') {// project nameconstsessionClient=newdialogflow.SessionsClient({keyFilename:""//json file position });constsessionPath=sessionClient.projectAgentSessionPath(projectId,sessionId);constrequest= {session:sessionPath,queryInput: {text: {text:msg,languageCode:'en-US', }, }, };
- cmd에서 chatbot.js가 있는 디렉토리로 이동
- 다음과 같은 명령어 실행
nodechatbotapi.js
- first_counsel.html / second_html 에 들어가서 원하는 말을 적는다
- 이후에 rule된 chatbot 대답을 확인할 수 있다.
(KoGPT2 training 방법https://github.com/haven-jeon/KoGPT2-chatbot 참조)
- answering.py 실행
- nodejs의 local 서버 실행
- deep_counsel.html에 원하는 말을 적는다.
- 일정 시간 후에 딥러닝 Chatbot의 대답을 확인할 할 수 있음
※ 데이터 셋 종류
- AI Hub(https://aihub.or.kr/) 웰니스 대화 데이터 셋
- ChatbotData(https://github.com/songys/Chatbot_data) 대화 데이터 셋
- AI Hub(https://aihub.or.kr/) 감성 말뭉치 데이터 셋 (전처리)
About
🏆졸업작품 우수 포스터상 - 토닥토닥 프로젝트 (웹)
Topics
Resources
Uh oh!
There was an error while loading.Please reload this page.
