Skip to main content

My short description for my project.

Project description

sentence splitting and intent classification

intent classification

to split a paragraph into sentences, to classify the intent of a sentence, implement the following:

arr = classification.intent_splitting.split('来点舒缓一点的音乐然后开始导航')

print(arr)

result: [('来点舒缓一点的音乐', 'genre'), ('然后开始导航', 'navi')]

#the usage of bert_semantic: #retrieve qa pairs from solr: question, answer = most_similar(s) if question: user_question = [s] * len(question) similarity = bert_semantic.instance.predict(user_question, question)

            for sent, score in zip(question, similarity):
                print('%s / %s = %f\t%f' % (s, sent, score))

            index = similarity.argmax()
            print('highest score for bert semantic')
            print('%s / %s = %f' % (s, question[index], similarity[index]))
            print('answer = ', answer[index])
            question = question[index]
            answer = answer[index]
            similarity = similarity[index]

            if similarity >= thredshold:
            	return answer            

        return None

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for cosmosnlp, version 5.2.0
Filename, size File type Python version Upload date Hashes
Filename, size cosmosnlp-5.2.0-py3-none-any.whl (2.5 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size cosmosnlp-5.2.0.tar.gz (3.6 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page