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('来点舒缓一点的音乐然后开始导航')


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

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page