Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,056 changes: 1,056 additions & 0 deletions Chat/.ipynb_checkpoints/Untitled-checkpoint.ipynb

Large diffs are not rendered by default.

1,139 changes: 1,139 additions & 0 deletions Chat/Untitled.ipynb

Large diffs are not rendered by default.

Binary file added Chat/final_model.h5
Binary file not shown.
1 change: 1 addition & 0 deletions Chat/final_model.pkl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
�
53 changes: 53 additions & 0 deletions Chat/intents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{"intents": [
{"tag": "greeting",
"patterns": ["Hi", "Hey", "How are you", "Is anyone there ?", "Hello", "Good day", "Whats up"],
"responses": ["Hello !", "Good to see you again !", "Hi there, how can I help ?", "Hello ! I'm Dexter . How may I help you ?", "Hey there !"],
"context_set": ""
},
{"tag": "book_table",
"patterns": ["Book a table","Can I book a table ?", "I want to book a table", "Book seat", "I want to book a seat", "Can I book a seat ?"],
"responses": [""],
"context_set": ""
},
{"tag": "available_tables",
"patterns": ["How many seats are available ?", "Available seats", "How many tables are available ?", "Available tables"],
"responses": [""],
"context_set": ""
},
{"tag": "goodbye",
"patterns": ["cya", "See you later", "Goodbye", "I am Leaving", "Have a Good day", "cya later", "I gotta go now", "I gotta rush now"],
"responses": ["Sad to see you go :(", "Talk to you later", "Goodbye !"],
"context_set": ""
},
{"tag": "age",
"patterns": ["how old", "how old is Dexter", "what is your age", "how old are you", "age ?"],
"responses": ["My master built me just a month ago .", "Just a month old !"],
"context_set": ""
},
{"tag": "name",
"patterns": ["what is your name", "what should I call you", "whats your name ?"],
"responses": ["You can call me Dexter .", "I'm Dexter !", "I'm Dexter aka The Restaurant Superbot ."],
"context_set": ""
},
{"tag": "hours",
"patterns": ["when are you guys open", "what are your hours", "hours of operation", "hours", "what is the timing"],
"responses": ["We are open 10am-12am Monday-Friday !"],
"context_set": ""
},
{"tag": "menu",
"patterns": ["Id like to order something", "whats on the menu", "what do you reccommend ?", "could i get something to eat", "Im hungry"],
"responses": [""],
"context_set": ""
},
{"tag": "contact",
"patterns": ["contact information", "contact us", "how can i contact you", "can i get the contact details", "I wanna give some feedback", "how can i give some feedback ?"],
"responses": ["You can contact us at contact@restaurantname .com"],
"context_set": ""
},
{"tag": "address",
"patterns": ["what is the location ?","whats the location", "where are you locatated ?", "where is the restaurant located ?", "address", "whats the address ?"],
"responses": ["You can locate us at Taj Lands End, Bandra Bandstand, Bandra West, Mumbai, Maharashtra 400 050"],
"context_set": ""
}
]
}
11 changes: 11 additions & 0 deletions Chat/sp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import azure.cognitiveservices.speech as speechsdk

def from_file():
speech_config = speechsdk.SpeechConfig(subscription="<paste-your-subscription-key>", region="<paste-your-region>")
audio_input = speechsdk.AudioConfig(filename="your_file_name.wav")
speech_recognizer = speechsdk.SpeechRecognizer(speech_config=speech_config, audio_config=audio_input)

result = speech_recognizer.recognize_once_async().get()
print(result.text)

from_file()
Binary file added Chat/vectorizer
Binary file not shown.
Binary file added Chat/vectorizer.pkl
Binary file not shown.
8 changes: 8 additions & 0 deletions request.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Hi Mam,

Please help me install pjsip over cloud as I am unable to do it.
This project is very helpfull to me and I need some guidance for the same.

Please contact me at pratyushjena.2k17@gmail.com or please provide me your email so that I can drop a mail.

Thank you
22 changes: 22 additions & 0 deletions sp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import azure.cognitiveservices.speech as speechsdk

def from_file():
speech_config = speechsdk.SpeechConfig(subscription="34c15a8a2f4342b487ce48da2e8bdd12", region="eastus")
audio_input = speechsdk.AudioConfig(filename="output.wav")
speech_recognizer = speechsdk.SpeechRecognizer(speech_config=speech_config, audio_config=audio_input)

result = speech_recognizer.recognize_once_async().get()
print(result.text)

if result.reason == speechsdk.ResultReason.RecognizedSpeech:
print("Recognized: {}".format(result.text))
elif result.reason == speechsdk.ResultReason.NoMatch:
print("No speech could be recognized: {}".format(result.no_match_details))
elif result.reason == speechsdk.ResultReason.Canceled:
cancellation_details = result.cancellation_details
print("Speech Recognition canceled: {}".format(cancellation_details.reason))
if cancellation_details.reason == speechsdk.CancellationReason.Error:
print("Error details: {}".format(cancellation_details.error_details))


from_file()
Binary file added src/chunk_15_816000.wav
Binary file not shown.
20 changes: 10 additions & 10 deletions src/runclient.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import sys
import pjsua as pj
import threading
import bothelper as bot
#import bothelper as bot
import time

current_call = None
Expand Down Expand Up @@ -48,7 +48,7 @@ def on_incoming_call(self, call):
listen_and_respond()

def listen_and_respond():
recorderid = lib.create_recorder("YOUR_FILE_PATH/input.wav")
recorderid = lib.create_recorder("input.wav")
recorderslot = lib.recorder_get_slot(recorderid)

# Connect sound device to wav record file
Expand All @@ -59,18 +59,18 @@ def listen_and_respond():
time.sleep(8)

lib.recorder_destroy(recorderid)
mybot = bot.BotHelper()
mybot.generate_response()
#mybot = bot.BotHelper()
#mybot.generate_response()

# Play wav file back to user
playerid = lib.create_player('botresponse.wav',loop=False)
playerid = lib.create_player('chunk_15_816000.wav',loop=False)
playerslot = lib.player_get_slot(playerid)
# Connect the audio player to the call
lib.conf_connect(playerslot,call_slot)

# Wait for the thing to be read for a few seconds then hang up
time.sleep(13)
current_call.hangup()
# Wait for the thing to be read for a few seconds then hang up
time.sleep(13)
current_call.hangup()

class MyCallCallback(pj.CallCallback):

Expand Down Expand Up @@ -124,7 +124,7 @@ def resetAll():
lib.start()

# Put your sIP client credentials here
acc = lib.create_account(pj.AccountConfig("SERVER_IP_ADDRESS", "USERNAME", "PASSWORD"))
acc = lib.create_account(pj.AccountConfig("sip.linphone.org", "chiku1064", "Bengaluru@96"))

acc_cb = MyAccountCallback(acc)
acc.set_callback(acc_cb)
Expand Down Expand Up @@ -152,7 +152,7 @@ def resetAll():
print "There is no call"
continue
current_call.hangup()
resetAll()
resetAll()

elif input == "q":
break
Expand Down