Extracting faq sub-intent from a custom action - rasa-nlu

I am using the following configuration: Rasa Version : 2.2.9 Rasa SDK Version : 2.2.0 Rasa X Version : None Python Version : 3.7.6 Operating System : Linux-5.4.0-71-generic-x86_64-with-debian-bullseye-sid
I would like to get a faq or chitchat sub-intent (not intent) form a custom action. When I use this command :
tracker.latest_message['intent'].get('name')
I get the intent faq… I would like to get a sub-intent like faq/ask_weather or faq/ask_name instead or even ask_weather or ask name.
Can you help me?

We do this in our demo here:
full_intent = (
tracker.latest_message.get("response_selector", {})
.get("faq", {})
.get("full_retrieval_intent")
)
If you're looking for the full intent of a "chitchat" retrieval intent, you'll have to replace "faq" in the above with "chitchat", and so on, for whatever prefix.

Related

Issue with OpenAI API key while using it in Windows

I have to fine-tune the OpenAI model on my custom dataset. I have created the dataset in jsonl format. I use the following commands on windows command line:
set OPENAI_API_KEY=<API key>
openai tools fine_tunes.prepare_data -f "train_data.jsonl"
The above commands run successfully and give me some suggestions for updating jsonl file. After this, I run the following command to fine-tune the 'curie' model.
openai api fine_tunes.create 'openai.api_key = <API key>' -t "train_data.jsonl" -m "curie"
But I am getting following issue:
←[91mError:←[0m Incorrect API key provided: "sk-iQJX*****************************************mux". You can find your API key at https://beta.openai.com. (HTTP status code: 401)
Can anybody help me out with this issue.
This is a common issue with an earlier version of the openai's CLI. If you haven't already, make sure you upgrade to the most recent version by doing
pip install --upgrade openai
One possible workaround is to just use a python script to do what you would normally do in the CLI.
# To train a model:
import os
import openai
os.environ["OPENAI_API_KEY"] = "sk-iQJX*****************************************mux"
os.system("openai api fine_tunes.create -t train_data.jsonl -m curie")
When assigning the API key in command line, dont use double quotes like:
API_KEY=ab-123123123123123231
This will solve the issue

Issue creating a Homebrew cask (livecheck unable to find the latest version)

I'm trying to submit a cask for Tentacle Sync Studio but I'm having issues with livecheck being able to find the most recent version. I ran brew audit --new-cask tentacle-sync-studio and received the following error - Version '1.30' differs from '' retrieved by livecheck.
cask "tentacle-sync-studio" do
version "1.30"
sha256 "4f7bdaef85b78f576babac91d57da3b3276cc98a2f81ac621bea96a48fe8796a"
url "https://tentaclesync.com/files/downloads/ttsyncstudio-v#{version.dots_to_underscores}.dmg"
name "Tentacle Sync Studio"
desc "Automatically synchronize video and audio via timecode"
homepage "https://tentaclesync.com/"
livecheck do
url "https://tentaclesync.zendesk.com/hc/en-us/articles/115003866805-Tentacle-Sync-Studio-macOS-"
strategy :page_match
regex(%r{/v?(\d+(?:\.\d+)+)/ttsyncstudio\.dmg}i)
end
depends_on macos: ">= :high_sierra"
app "Tentacle Sync Studio.app"
end
I might not be using the correct "strategy" and I honestly have no idea how to set the regex despite reading Homebrew's instructions. Any help is appreciated.
The vitalsource-bookshelf cask had a similar issue:
Previous livecheck URL had Cloudflare protection, use API URL instead.
You'll want to change
https://tentaclesync.zendesk.com/hc/en-us/articles/115003866805-Tentacle-Sync-Studio-macOS-
to
https://tentaclesync.zendesk.com/api/v2/help_center/en-us/articles/115003866805
However, a few more changes must be made for the livecheck to work:
Change the regex to href=.*?/ttsyncstudio-v?(\d+(?:[._-]\d+)+)\.dmg
We want to match this string: href=\"https://tentaclesync.com/files/downloads/ttsyncstudio-v1_30.dmg
href=.*? is a convention in homebrew/cask
[._-] matches a dot, underscore, or hyphen (another convention)
Add a do to strategy :page_match to change underscores to dots:
strategy :page_match do |page, regex|
page.scan(regex).map { |match| match[0].tr("_", ".") }
end
match[0] corresponds to the regex capture (\d+(?:[._-]\d+)+)
Finally, your cask file should look like this.

The number '3' gets skipped in ruby-cucumber autoamtion [duplicate]

For some reason, I am unable to write character '3' into the input element on the page.
This code:
chrome_options = Options()
chrome_options.add_argument('--dns-prefetch-disable')
chrome_options.add_argument('--no-proxy-server')
chromeDriverPath = self.getChromeDriverPath()
os.environ["webdriver.chrome.driver"] = chromeDriverPath
self.driver = webdriver.Chrome(chromeDriverPath, chrome_options=chrome_options)
self.driver.get(self.loginUrl)
login = self.driver.find_element_by_id('login_credit')
login.send_keys("12345")
results in "1245" being written in the login input...
Can someone help please?
I use python 2.7, the latest chrome and the latest chromedriver
EDIT:
login.send_keys("3")
login.send_keys("\3")
don't work either.
login.send_keys("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!##$%^&*()")
- only the "3" was missing in the string...
what worked was
login.send_keys(Keys.NUMPAD3)
as Andersson suggested below, but this is not a solution.
I tried it in the google search box and I experienced the same behaviour.
Updating to latest chrome driver resolved this issue.
Instead of using send_keys("12345") you can use any of the alternatives mentioned below :
Use Keys.NUMPAD3 :
login.send_keys(Keys.NUMPAD3)
Use JavascriptExecutor with getElementById :
self.driver.execute_script("document.getElementById('login_credit').value='12345'")
Use JavascriptExecutor with getElementsById :
self.driver.execute_script("document.getElementsById('login_credit')[0].value='12345'")
Strange issue, Try to pass string variable in send_keys and try may be it works for you
my_str = "12345"
login = self.driver.find_element_by_id('login_credit')
login.send_keys(my_str)

Value error: embedded null byte when using pelican content command to generate my site on Windows

I want to use Pelican to generate my blog site. I install python 3 and Pelican by pip on Windows 7 with the guidance of docs quickstart. And I created a directory under D:/blog to store my site files. Then create a file named test.md under D:/blog/content and test.md's content is the same as the Quickstart guidance. When going to step Generate your site , I get an error
in gitbash as follows:
So, why it happened and how to fix it? Thanks.
Updated, use pelican content --debug command to get traceback, and the key traceback is here:
According to the bug report, this problem is due to the incorrect locale settings.
Execute the fllowing code,if a error occur,there exists a problem about locale settings.
import locale, time
locale.setlocale(locale.LC_ALL, 'ko')
time.strftime('%a')
Solution:
The error file is utils.pyunder the path..\Lib\site-packages\pelican\utils.py.Add the following code in strftime function to solve the problem.
locale.setlocale(locale.LC_ALL, 'en')
After adding (for example):
def strftime(date, date_format):
'''
Replacement for built-in strftime
...(Omit some words)
replacing formatted output back.
'''
locale.setlocale(locale.LC_ALL, 'en')
def strip_zeros(x):
return x.lstrip('0') or '0'
c89_directives = 'aAbBcdfHIjmMpSUwWxXyYzZ%'
you can also see the Chinese version in this blog post

Use Puppet Apache class to install Apache1 on CentOS

I'm trying to create a Vagrant setup using CentOS 6.4 and Apache 1.3 (this is for a legacy application). I am using Puppet (though if an answer in Chef is easier, I'd be happy to use it) and the Puppetlabs Apache class. The issue I'm having is that it installs Apache 2.2, but I don't see how to make it install Apache 1.3 instead.
What am I doing wrong and how can I do it right? (Answers of "Upgrade your app" will be downvoted - I don't have the authority to make that decision.)
The module you're using doesn't explicitly expose a parameter to specify which version of the httpd package you want to install.
Instead of using Puppetlabs module, you could use the Apache module from Alessandro Franceschi (source here - also on the forge)). If the package you need to install has a different name than httpd, the module exposes a package parameter which you can override like this:
class { 'apache':
package => 'apache13',
}
If, instead, Apache 1.3 is provided by the same httpd package by declaring the specific version you want, you can rely on the version parameter:
class { 'apache':
version => '1.3.39',
}
Clearly, you can also combine the two parameters together.
using those modules return the following error on Redhat:
Error 400 on SERVER: Illegal expression.
A Type-Name is unacceptable as function name in a Function Call at /etc/puppet/modules/apache/man.

Resources