📜  项目理念 |人工智能治疗师

📅  最后修改于: 2022-05-13 01:57:41.302000             🧑  作者: Mango

项目理念 |人工智能治疗师

项目名称:人工智能治疗师

简介:输入是用户提供的关于他一天如何过的两三行的描述。我们的程序使用自然语言处理来检测用户的感受。他可能会感到沮丧、恐惧、愤怒等。然后使用推荐系统根据他当前的情绪向他展示内容。例如,如果用户感到沮丧,程序将向他展示励志思想、博客等。

概念框架:
该项目将结合自然语言处理和推荐系统。通过 NLP 构建的管道模型会将用户输入置于“A”、“B”、“C”、“D”类中的任何一个中。
A类:愤怒
B类:轻度抑郁
C级:严重抑郁症
D类:恐惧
在此之后,推荐系统将推荐与特定类别有关的报价和演讲,以帮助用户。

代码:

import numpy as np
import pandas as pd
from pandas import Series, DataFrame
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
import string
from nltk.corpus import stopwords
  
#data is our input dataset containing user input lines and it has a column of emotional class. 
#The code will not work in IDE as no dataset has been provided
  
  
#function to remove punctuations and stopwords
def function_preprocess (mess):
    nopunc = []
    for char in mess :
        if char not in string.punctuation:
            nopunc.append(char)
    nopunc=''.join(nopunc)
    clean = []
    for word in nopunc.split():
        word = word.lower()
        if word not in stopwords.words('english'):
            clean.append(word)
    return clean
  
from sklearn.pipeline import Pipeline 
from sklearn.naive_bayes import MultinomialNB
from sklearn.feature_extraction.text import CountVectorizer as cv
from sklearn.feature_extraction.text import TfidfTransformer
  
#building our NLP model using naive bayes as classifier
pipeline = Pipeline([('bow', cv(analyzer=function_preprocess)),
                    ('tfidf', TfidfTransformer()),
                    ('classifier', MultinomialNB()),
                    ])
pipeline.fit(data, emotional_class)

推荐系统将使用基于邻居的协同过滤技术创建,因为它会建议对相似用户有帮助的事物。

使用的工具:
1. 使用语言: Python
2. 算法:协同过滤、朴素贝叶斯、自然语言处理

应用:
1. 可用于识别患有抑郁症、焦虑症等的人,同时也可以帮助他们。
2. 如果用户患有抑郁症,程序会建议他去看医生,并通知他的亲戚。
3.如果用户经常生气,程序会建议他处理愤怒的技巧。
4. 该模型将有助于精神科医生和治疗师治愈他们的客户。

团队成员:
1. 阿贝古普塔
2. 阿比纳夫·特里帕蒂

如果您喜欢 GeeksforGeeks 并愿意做出贡献,您还可以使用 write.geeksforgeeks.org 撰写文章或将您的文章邮寄至 review-team@geeksforgeeks.org。在 GeeksforGeeks 主页上查看您的文章并帮助其他 Geeks。