5

मैं किसी प्रकार का स्वचालन करने के लिए एक अमेज़ॅन एलेक्सा कौशल किट बनाने की कोशिश कर रहा हूं जिसमें स्ट्रिंग्स और संख्याओं (a-test12fish) शामिल भाषण इनपुट लेना होगा।अमेज़ॅन एलेक्सा कौशल किट (एएसके) मिश्रित स्ट्रिंग को संख्याओं के साथ इनपुट कैसे दें?

जब मैंने एलेक्सा स्किल्स किट में कस्टम स्लॉट का उपयोग किया है, तो यह मुझे संख्याओं के साथ तारों में कुंजी नहीं दे रहा है।

Error: Invalid text input. Text should begin with alphabets and should only contain alphabets, whitespaces, periods or apostrophes

मैं इस त्रुटि को कैसे दूर कर सकते हैं: जब मैं ask alexa, dangerZone find a-test12fish में प्रमुख करने के लिए प्रयास करते हैं, मैं निम्नलिखित त्रुटि मिल रही है?

+0

हैलो साथिश, क्या आपने इसे अभी तक बाहर निकाला है? – Kal

उत्तर

0

आपने यह इंगित नहीं किया कि आप उपयोगकर्ता को मूल्य कहने का इरादा रखते हैं। उदाहरण के लिए, "एक डैश परीक्षण बारह मछली" या "एक डैश टी ई एस टी एक दो एफ आई एस एच।" किसी भी मामले में, मान्यता प्रणाली को शब्दों को पहचानने के लिए डिज़ाइन किया गया है और वह डेटा मान्य शब्द नहीं है।

समस्या को हल करने के लिए, आप एक कस्टम स्लॉट प्रकार बनाकर एक कस्टम स्लॉट प्रकार बनाकर एक वर्तनी समाधान (बाद वाला इनपुट) बनाने का प्रयास कर सकते हैं, जिसमें सभी वैध वर्ण मानों और नमूना उच्चारण वैध लंबाई का समर्थन करते हैं।

आपके पास संदेश को फिर से इकट्ठा करने के लिए कुछ काम होगा, लेकिन यह बहुत जटिल नहीं होना चाहिए। संभावित चुनौती अभी भी पहचानकर्ता से होगी। जबकि मैंने एलेक्सा के तहत इस परिदृश्य का परीक्षण नहीं किया है, वहीं मैंने चरम लंबाई, अल्फा न्यूमेरिक तारों के साथ खराब तरीके से उपयोग किया है। आवाजें बहुत समान हैं और ऐसे कई मूल्य हैं जिन्हें विराम और पृष्ठभूमि शोर के लिए आसानी से गलत किया जा सकता है। phonetic alphabet का उपयोग करने के लिए आसपास का सामान्य काम है।

+0

इनपुट के लिए धन्यवाद, मैं इसे "एक हाइफ़न टेस्ट एक दो मछली" के रूप में कहूंगा, मतलब है कि मैं फोनेटिक वर्णमाला का उपयोग करने का प्रयास करता हूं – Sathish

0

सिस्टम की सीमा के भीतर एक अलग दृष्टिकोण खेलेंगे। आप इसे एक अलग नाम से संदर्भित कर सकते हैं।

"उपयोगकर्ता के लिए एक टेस्ट 12 फिश" के साथ तत्काल उपयोगकर्ता और आगे। और आंतरिक रूप से इसे अपने विशिष्ट मूल्य पर मैप करें।

-3

एसएसएमएल का उपयोग करें, जहां आप अपनी खुद की शैली का शैली तैयार कर सकते हैं। कृपया जांचें।

2

यहां एक समाधान है।

शायद आप इसे इरादे स्कीमा में पूरा नहीं करना चाहते हैं। इसके बजाय नोड.जेएस के साथ कस्टम मोड बनाने का प्रयास करें जो अक्षरों, संख्याओं और प्रतीकों को एक प्रतिक्रिया में संकलित करता है। यह अल्फा न्यूमेरिक इनपुट मोड का मेरा प्रस्तुतिकरण है। कृपया ध्यान दें: मैंने अभी आपके प्रश्न के जवाब में यह लिखा है और इसे एक बड़े कौशल में परीक्षण नहीं किया है। इसके साथ ही मुझे MODES के साथ बड़ी सफलता मिली है और जब मुझे मौका मिलता है तो निश्चित रूप से इसे अपने कौशल में लागू कर देगा।

इस कोड के पीछे विचार यह है कि आप एक अलग मोड कि NumberIntent, LetterIntent, SymbolIntent के अलावा अन्य सभी उद्देश्यों पर ध्यान नहीं देता है, और कुछ मदद सुविधाओं में उपयोगकर्ताओं को धक्का है। उपयोगकर्ता जल्दी से अपने अल्फा न्यूमेरिक मान में प्रवेश करता है और पूरा होने पर पूर्ण इंटेन्टेंट सक्रिय करता है। उस अल्फान्यूमेरिक मान का उपयोग तब आपके कौशल में कहीं और किया जा सकता है। यदि आपने Modes का उपयोग नहीं किया है, तो ध्यान दें कि पूरा होने या बाहर निकलने पर आपको LOBBYMODE पर रीडायरेक्ट किया जाएगा जहां आप अपने कौशल में अन्य उद्देश्यों तक पहुंच जारी रख सकते हैं।

var lobbyHandlers = Alexa.CreateStateHandler(states.LOBBYMODE, { 

    'enterPasswordIntent': function() { 
     this.attributes['BUILDPASSWORD'] = ''; 
     this.handler.state = states.PASSWORDMODE; 
     message = ` You will now create a password one letter, number or symbol at a time. there will be no message after each entry. simply wait for alexa's ring to become solid blue then stay your next value. When you are satisfied say complete. Begin now by saying a number, letter, or keyboard symbol. `; 
     reprompt = `Please say a number letter or symbol`; 
     this.emit(':ask', message, reprompt); 
    }, 

    //Place other useful intents for your Skill here 

    'Unhandled': function() { 
     console.log("UNHANDLED"); 
     var reprompt = ` You're kind of in the middle of something. Say exit to end createing this password. otherwise say complete if you've stated the whole password. or repeat to hear the current password you've entered. `; 
     this.emit(':ask', reprompt, reprompt); 
    } 
}); 


var buildAlphaNumericPasswordHandlers = Alexa.CreateStateHandler(states.PASSWORDMODE, { 
    'numberIntent': function() {// Sample Utterance: ninty nine AMAZON.NUMBER 
     var number = this.event.request.intent.slots.number.value; //I believe this returns a string of digits ex: '999' 
     this.attributes['BUILDPASSWORD'] = this.attributes['BUILDPASSWORD'].concat(number); 
     message = ``; //No message to make saying the next letter, number or symbol as fluid as possible. 
     reprompt = `Please say the next number letter or symbol`; 
     this.emit(':ask', message, reprompt); 
    }, 
    'letterIntent': function() {// Sample Utterance: A -- Custom Slot LETTERS [A, b, c, d, e, ... ] 
     var letter = this.event.request.intent.slots.letter.value; 
     this.attributes['BUILDPASSWORD'] = this.attributes['BUILDPASSWORD'].concat(letter); 
     message = ``; //No message to make saying the next letter, number or symbol as fluid as possible. 
     reprompt = `Please say the next number letter or symbol`; 
     this.emit(':ask', message, reprompt); 
    }, 
    'symbolIntent': function() {// Sample Utterance: Dash -- Custom Slot SYMBOLS [Pound, Dash, Dollar Sign, At, Exclamation point... ] 
     var symbol = this.event.request.intent.slots.symbol.value; 

     // Create a dictionary object to map words to symbols ex Dollar Sign => $. Will need this because you likely cant put $ as a custom slot value. Can also map multiple names to the same value ex. Dash => Tack = \> "-" 
     var singleCharacterSymbol = symbolDict[symbol]; //^^^ Need to create dictionary 

     this.attributes['BUILDPASSWORD'] = this.attributes['BUILDPASSWORD'].concat(singleCharacterSymbol); 
     message = ``; //No message to make saying the next letter, number or symbol as fluid as possible. 
     reprompt = `Please say the next number letter or symbol`; 
     this.emit(':ask', message, reprompt); 
    }, 
    'CompleteIntent': function() { //Sample Utterance: Complete 
     console.log("COMPLETE"); 
     this.handler.state = states.LOBBYMODE; 
     var reprompt = ` Your entry has been saved, used to execute another function or checked against our database. `; 
     this.emit(':ask', reprompt, reprompt); 
    }, 
    'ExitIntent': function() { //Sample Utterance: Exit 
     console.log("EXIT"); 
     this.handler.state = states.LOBBYMODE; 
     message = `You have returned to the lobby, continue with the app or say quit to exit.`; 
     this.emit(':ask', message, message); 
    }, 
    'RepeatIntent': function() { 
     var currentPassword = this.attributes['BUILDPASSWORD']; 
     var currentPasswordExploded = currentPassword.replace(/(.)(?=.)/g, "$1 "); //insert a space between each character so alexa reads correctly. 
     var message = ` Your current entry is as follows. `+currentPasswordExploded; 
     var reprompt = ` say complete if you've stated the whole password. Otherwise continue to say numbers letters and symbols. `; 
     this.emit(':ask', reprompt, reprompt); 
    }, 
    'Unhandled': function() { 
     console.log("UNHANDLED"); 
     var reprompt = ` You're kind of in the middle of something. Say exit to end creating this password, say complete if you've stated the whole password, say repeat to hear the current password you've entered, or continue to state letters, numbers and symbols `; 
     this.emit(':ask', reprompt, reprompt); 
    } 
}); 
संबंधित मुद्दे