vania-janet/multiturn-rag-retrieval-data huggingface dataset:
{"content":[{"id":1,"name":"Grog","description":"A secret mixture that contains one or more of the following: Kerosene, Propylene Glycol, Artificial Sweeteners, Sulfuric Acid, Rum, Acetone, Battery Acid, red dye2, Scumm, Axle grease and/or pepperoni."},{"id":2,"name":"Ship's Horn","description":"Made in Hong Kong"},{"id":3,"name":"Well-Polished Old Saw","description":"Found at the bottom of the sea. Great condition."},{"id":4,"name":"Rubber Chicken With A Pulley In The Middle","description":"What possible use could this have?"},{"id":5,"name":"Idol of Many Hands","description":"Also known as the Fabulous Idol"},{"id":6,"name":"How Much Wood? - Hardcover","description":"From the Woodchuck Mystery series"}],"pageable":{"sort":{"sorted":false,"unsorted":true,"empty":true},"pageNumber":0,"pageSize":20,"offset":0,"paged":true,"unpaged":false},"last":true,"totalPages":1,"totalElements":6,"sort":{"sorted":false,"unsorted":true,"empty":true},"numberOfElements":6,"first":true,"size":20,"number":0,"empty":false}%

curl http://$appname-customers.mybluemix.net/customers
.addTagNames("tag_test_1")
.addTagNames("tag_test_2")
.build();

Response<TagResults> response = service.attachTag(attachTagOptions).execute();
TagResults tagResults = response.getResult();
System.out.println(tagResults.toString());

resource_model = {'resource_id': serviceid_crn}

tag_results = global_tagging_service.attach_tag(
resources=[resource_model],
tag_names=['tag_test_1', 'tag_test_2'],
tag_type='user').get_result()

print(json.dumps(tag_results, indent=2))

resourceModel := &globaltaggingv1.Resource{
ResourceID: &serviceidCRN,
}

attachTagOptions := globalTaggingService.NewAttachTagOptions(
[]globaltaggingv1.Resource{resourceModel},
)
attachTagOptions.SetTagNames([]string{"tag_test_1", "tag_test_2"})
attachTagOptions.SetTagType("user")

tagResults, response, err := globalTaggingService.AttachTag(attachTagOptions)
if err != nil {
panic(err)
}
b, _ := json.MarshalIndent(tagResults, "", " ")
fmt.Println(string(b))

const resourceModel = {
resource_id: serviceidCrn,
};

const params = {
resources: [resourceModel],
tagNames: ["tag_test_1", "tag_test_2"],
tagType: 'user',
};

globalTaggingService.attachTag(params)
The flags string is formed by combining a subset of these flags by using | as the separator:



* CANON_EQ
* CASE_INSENSITIVE
* DOTALL
* LITERAL
* MULTILINE
* UNICODE (meaningless without CASE_INSENSITIVE)
* UNIX_LINES



An example of a flags string is

'UNICODE | CASE_INSENSITIVE'

Consider this example where MatchesRegex is used to identify product names along with their version number mentions to the right. Unlike the example in ContainsRegex section, the exact version number is identified as the token immediately following the product name mention.

-- gather right context around product name mention
create view ProductNamesWithContext as
select
P.name as name,
RightContext(P.name, 5) as rightctxt
from ProductNames P;

-- use a regex to identify products with version number mentions to the right
create view ProductsWithVersionNumbers as
select
P.name as productname,
P.rightctxt as productversion
from ProductNamesWithContext P
where MatchesRegex (/vd((.d)+)?/, P.rightctxt);





 Not 

The Not function takes a single Boolean argument and returns its complement. If the argument is null, the function returns null.





 NotNull 

The NotNull function takes a single argument of any type.

As its name suggests, the NotNull function returns TRUE if the value of the argument is not null, and FALSE if the argument is null.





 Or 

The Or function takes a variable number of non-null Boolean arguments. If any argument is null, the function returns null.

The Or function returns TRUE if any of them evaluates to TRUE.





 Overlaps 

The Overlaps function takes two span arguments:

Overlaps(<span1>, <span2>)

The function returns TRUE if the two input spans overlap in the document text. The function returns null if either argument is null.







 Scalar functions
"id": "94c686c3-a790-4d8d-ba42-2bddf01b311c",
"result_metadata": {
"parent_id": "94c686c3-a790-4d8d-ba42-2bddf01b311c",
"segment": 1,
"total_segments": 3
},
"text": "This is the text that falls under heading 1 and should be therefore split into its own segment."
},
"extracted_metadata": {
"sha1": "45ede479df67d78f2205ea7e714843375d3029c0",
"filename": "doc-with-different-heading-levels.html",
"file_type": "html",
"title": "My Document"
},
"title": "My Document",
"html": "<?xml version='1.0' encoding='UTF-8' standalone='yes'?><html>n<head>"
}
Show more

All segments include an:



* id - The id of this segment.
* title - The title field is extracted from the HTML title field. (2019-03-25 or later API version string.)
* segment_metadata section which contains:



* parent_id - The parent_id is the id of the original document. For the first segment, the id and parent_id are identical.
* segment - The number of this segment.
* total_segments - The total number of segments the document was split into.



* extracted_metadata section which contains:



* sha1 - Corresponds to the original document.
* title - The title field is extracted from the HTML title field. (2019-03-25 or later API version string.)
* filename - Corresponds to the original document.
* file_type- Corresponds to the original document.



* text field
* html field









 Updating a segmented document
SSML elements 

With the IBM Watson® Text to Speech service, you can use most Speech Synthesis Markup Language (SSML) elements and attributes to control the synthesis of your text.



 Supported elements and attributes 

Table 1 summarizes the service's support for SSML elements and attributes:



* Full means that the service fully supports the element or attribute with its HTTP and WebSocket interfaces.
* Partial means that the service's support for the element or attribute is limited in one of the following ways:



* The service supports only some aspects of the element or attribute.
* The service supports the element or attribute with only some of its voices.
* The service supports the element or attribute with only one of its interfaces, HTTP or WebSocket.



* None means that the service does not support the element or attribute.



The following sections provide descriptions of each element or attribute, including examples, restrictions, and whether the service's support differs from standard SSML. Support for some attributes and values differs slightly from the SSML specification. For more information, see [W3C Speech Synthesis Markup Language (SSML) Version 1.1](http://www.w3.org/TR/speech-synthesis/).



Table 1. SSML elements and attributes

 Element or attribute Support Element or attribute Support 

 [<audio> element](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-elementsaudio_element) None [<prosody> element](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-elementsprosody_element) Partial 
 [<break> element](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-elementsbreak_element) Full <br><br> * contour attribute<br><br><br> None
Editing database description and tags 

To edit the description and tags of a database, use one of the following methods:



*  Editing database description and tags in list view





1.  Click the name of database. The database information page opens.
2.  In the Details tab, click Edit.
3.  In the Description field, enter the description of the bucket or edit the existing description.
4.  In the Tags field, select the tags from list or start typing to define a new tag.
5.  Click Save.





*  Editing database description and tags in topology view





1.  Click the database. The database information page opens.
2.  In the Details tab, click Edit.
3.  In the Description field, enter the description of the bucket or edit the existing description.
4.  In the Tags field, select the tags from list or start typing to define a new tag.
5.  Click Save.
curl --location --request POST 'https://cpd-abc.example.com/discovery/abc-wd/instances/1671204318684041/api/v2/projects/d457fcd9-a4ce-4637-a340-33123b5cbe2c/collections/2d47dbcc-64c7-84e9-0000-01851bb9d998/analyze?version=2020-08-30' --header 'Authorization: Bearer ...' --form 'file={
"html":"<html><head>This is my html file</head><body><p>My file contains a table.</p><table><tbody><tr><th>Holiday</th><th>Popular greeting</th></tr><tr><td>Christmas</td><td>Merry Christma!s</td></tr></tbody></table></body></html>",
"text":"This is a sentence that contains key words, such as George Washington and Boston, MA."
}'





 Results 

The results show the output of the Entities, Keywords, and Table Understanding enrichments on the text and html fields that were submitted.

{
"result": {
"text": [
"This is a sentence that contains key words, such as George Washington and Boston, MA."
],
"enriched_text": [
{
"keywords":
{
"text": "George Washington",
"mentions":
{
"text": "George Washington",
"location": {
"begin": 52,
"end": 69
}
}
],
"relevance": 0.952591
},
{
"text": "Boston",
"mentions":
{
"text": "Boston",
"location": {
"begin": 74,
"end": 80
"xpaths": []
},
"exclude_tag_attributes": [
"EVENT_ACTIONS"
],
"extracted_fields": {
"{field_name_1}": {
"css_selector": "{CSS_selector_expression_1}",
"type": "{field_type}"
},
...
"{field_name_N}": {
"css_selector": "{CSS_selector_expression_N}",
"type": "{field_type}"
}
}
}
}
...
}
Show more

Finally, the following passage shows the configuration the new name and description as well as some CSS selectors. The selectors match items in the HTML example listed below the passage.

{
"name": "Extract JSON config",
"description": "New configuration enabling extraction of JSON fields from HTML",
"conversions": {
...
"html": {
"exclude_tags_completely": [
"script",
"sup"
],
"exclude_tags_keep_content": [
"font",
"em",
"span"
],
"exclude_content": {
"xpaths": []
},
"keep_content": {
"xpaths": []
},
"exclude_tag_attributes": [
"EVENT_ACTIONS"
],
"extracted_fields": {
"chapters": {
"css_selector": ".chapter",
"type": "array"
},
"authors": {
"css_selector": ".author"
},
"authors_str": {
"css_selector": ".author",
"type": "string"
},
"comments": {
* Flag: --content-type MIME



* Optional: A MAP of metadata to store.



* Flag: --metadata MAP JSON Syntax: The --metadata flag takes the file:// prefix that is used to load the JSON structure from the specified file.





{
"file_name": "file_20xxxxxxxxxxxx45.zip",
"label": "texas",
"state": "Texas",
"Date_to": "2019-11-09T16:00:00.000Z",
"Sha256sum": "9e39dxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx8ce6b68ede3a47",
"Timestamp": "Thu, 17 Oct 2019 09:22:13 GMT"
}



* Optional: The REGION where the bucket is present. If this flag is not provided, the program will use the default option specified in config.



* Flag: --region REGION



* Optional: Output FORMAT can be only json or text.



* Flag: --output FORMAT













 Manually controlling multipart uploads 

The IBM Cloud Object Storage CLI provides the ability for users to upload large files in multiple parts by using the AWS multipart upload functions. To initiate a new multipart upload, run the multipart-upload-create command, which returns the new upload instance's upload ID. To continue with the upload process, you must save the upload ID for each subsequent command. This command requires you to generate an MD5 hash:

{object data} | openssl dgst -md5 -binary | openssl enc -base64

After running the multipart-upload-complete command, run part-upload for each file part you want to upload. For multipart uploads, every file part (except for the last part) must be at least 5 MB. To split a file into separate parts, you can run split in a terminal window.
[<audio> element](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-elementsaudio_element) None [<prosody> element](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-elementsprosody_element) Partial 
 [<break> element](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-elementsbreak_element) Full <br><br> * contour attribute<br><br><br> None 
 [<desc> element](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-elementsdesc_element) None <br><br> * duration attribute<br><br><br> None 
 [<emphasis> element](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-elementsemphasis_element) Partial <br><br> * [pitch attribute](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-elementsprosody-pitch)<br><br><br> Full 
 [<express-as> element](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-elementsexpress-as_element) Partial <br><br> * range attribute<br><br><br> None 
 [<lexicon> element](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-elementslexicon_element) None <br><br> * [rate attribute](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-elementsprosody-rate)<br><br><br> Full
POST https://{endpoint}/{bucket-name}/{object-name}?uploadId={uploadId}= path style
POST https://{bucket-name}.{endpoint}/{object-name}?uploadId={uploadId}= virtual host style

The body of the request must contain an XML block with the following schema:



 Element Type Children Ancestor Constraint 

 CompleteMultipartUpload Container Part <br><br> * <br><br><br> <br><br> * <br><br><br> 
 Part Container PartNumber, ETag Delete <br><br> * <br><br><br> 
 PartNumber String <br><br> * <br><br><br> Object Valid part number 
 ETag String <br><br> * <br><br><br> Object Valid ETag value string 



<CompleteMultipartUpload>
<Part>
<PartNumber>{sequential part number}</PartNumber>
<ETag>{ETag value from part upload response header}</ETag>
</Part>
</CompleteMultipartUpload>

Example request

POST /some-bucket/multipart-object-123?uploadId=0000015a-df89-51d0-2790-dee1ac994053 HTTP/1.1
Authorization: Bearer {token}
Content-Type: text/plain; charset=utf-8
Host: s3.us.cloud-object-storage.appdomain.cloud
Content-Length: 257

Example request

POST /some-bucket/multipart-object-123?uploadId=0000015a-df89-51d0-2790-dee1ac994053 HTTP/1.1
* location: The location of the section title in the input document as defined by its begin and end indexes.



* title: If identified, the title or caption of the current table of the form Table x.: .... Empty when no title is identified. When present, the title is excluded from the contexts array of the same table.



* location: The location of the title in the input document as defined by its begin and end indexes.
* text: The text of the identified table title or caption.



* table_headers: An array of table-level cells applicable as headers to all the other cells of the current table. Each table header is defined as a collection of the following elements:



* cell_id: The unique ID of the cell in the current table.
* location: The location of the cell in the input document as defined by its begin and end indexes.
* text: The textual contents of the cell from the input document without associated markup content.
* row_index_begin: The begin index of the cell's row location in the current table.
* row_index_end: The end index of the cell's row location in the current table.
* column_index_begin: The begin index of the cell's column location in the current table.
* column_index_end: The end index of the cell's column location in the current table.



* column_headers: An array of column-level cells, each applicable as a header to other cells in the same column as itself, of the current table. Each column header is defined as a collection of the following items:



* cell_id: The unique ID of the cell in the current table.
* location: The location of the cell in the input document as defined by its begin and end indexes.
* text: The textual contents of the cell from the input document without associated markup content.
* text_normalized: Normalized column header text.
* row_index_begin: The begin index of the cell's row location in the current table.
* row_index_end: The end index of the cell's row location in the current table.
The following example illustrates how the Remap function is used to map spans from the detagged text back to their equivalents in the original source.

-- Strip out tags from each document, provided that the document
-- is in HTML or XML format.
-- Remember the locations and content of all <A> and <META> tags
-- in the original source document.
detag Document.text as DetaggedDoc
detect content_type always
annotate
element 'a' as Anchor
with attribute 'href' as target,
element 'meta' as Meta
with attribute 'name' as name
and attribute 'content' as content;

output view DetaggedDoc;

-- Create a view containing all lists of keywords in the
-- document's META tags.
create view MetaKeywordsLists as
select M.content as list
from Meta M
where MatchesRegex(/keywords/, 'CASE_INSENSITIVE', M.name)
and NotNull(M.content);

-- Create a dictionary of "interesting" web sites
create dictionary InterestingSitesDict as
(
'ibm.com', 'slashdot.org'
);

-- Create a view containing all anchor tags whose targets contain
-- a match of the "interesting sites" dictionary.
create view InterestingLinks as
select A.match as anchortext, A.target as href
from Anchor A
where ContainsDict('InterestingSitesDict', A.target);

-- Find all capitalized words in the anchor text of links to
-- "interesting" web sites.
create view InterestingWords as
extract I.href as href,
regex /[A-Z]+/ on 1 token in I.anchortext as word
from InterestingLinks I;

-- Map spans in the InterestingWords view back to the original
-- HTML or XML source of the document.
create view InterestingWordsHTML as
select I.href as href, Remap(I.word) as word
from InterestingWords I;
: Resource type on which the tags should be attached (required for Classic Infrastructure resource of type SoftLayer_Hardware, SoftLayer_Network_Application_Delivery_Controller, SoftLayer_Network_Subnet_IpAddress or SoftLayer_Network_Vlan only).

--tag-type value
: Type of the tag. Only allowed values are: user, service or access (default value : user).

--account-id value
: The ID of the account that owns the resources to be detached (required if tag-type is set to service).

-q, --quiet
: Suppress verbose output.





 Examples 



* To detach the user tag MyTag from a Kubernetes cluster named MyCluster, first look for the CRN of the cluster you would like to detach the tag from:

ibmcloud resource search 'type:k8-cluster AND name:MyCluster'

Take note of the CRN, which is a string similar to the following example:

crn:v1:bluemix:public:containers-kubernetes:us-south:a/a27a4741a57dcf5c965939adb66fe1c7:a46242e638ca47b09f10e9a3cbe5687a::
* To detach the tag, run the following command:

ibmcloud resource tag-detach --tag-names MyTag --resource-id rn:v1:bluemix:public:containers-kubernetes:us-south:a/a27a4741a57dcf5c965939adb66fe1c7:a46242e638ca47b09f10e9a3cbe5687a::
* To detach the user tag MyTag to a resource named MyResource:

ibmcloud resource tag-detach --tag-name MyTag --resource-name 'MyResource'
* To detach the user tag MyTag to a classic infrastructure virtual guest named MyVM, first look for the ID of the virtual guest you would like to detach the tag from:
In addition to the bucket identifier and object key, you will also need the correct [endpoint](https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-endpoints). The resulting XML object is also shown, where the "Tag" element will be repeated for each tag assigned to the object. If there are no tags, the response will return XML with an empty element, <TagSet />.

curl 'https://<endpoint>/<bucketname>/<objectname>?tagging' -H 'Authorization: bearer <token>'

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Tagging xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<TagSet>
<Tag>
<Key>Example Key</Key>
<Value>Value Example</Value>
</Tag>
</TagSet>
</Tagging>

Of course, before tags can be viewed they must be created, which we will turn to next.





 Creating tags 

Tags must comply with the following restrictions:



* An object can have a maximum of 10 tags
* For each object, each tag key must be unique, and each tag key can have only one value.
* Minimum key length - 1 Unicode characters in UTF-8
* Maximum key length - 128 Unicode characters in UTF-8
* Maximum key byte size - 256 bytes
* Minimum value length - 0 Unicode characters in UTF-8 (Tag Value can be empty)
* Maximum value length - 256 Unicode characters in UTF-8
* Maximum value byte size - 512 bytes
* A Tag key and value may consist of US Alpha Numeric Characters (a-zA-Z0-9), and spaces representable in UTF-8, and the following symbols: !, _, ., , , (, ), -, :
* Tag keys and values are case-sensitive
* ibm: cannot be used as a key prefix for tags
curl -X POST --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" --header "Content-Type: application/json" -d '{ "resources": [{ "resource_id": "{SERVICEID_CRN}" }], "tag_names": ["tag_test_1", "tag_test_2"] }' "{base_url}/v3/tags/detach?tag_type=user"

Resource resourceModel = new Resource.Builder().resourceId(serviceidCRN).build();
DetachTagOptions detachTagOptions = new DetachTagOptions.Builder()
.addResources(resourceModel)
.addTagNames("tag_test_1")
.addTagNames("tag_test_2")
.tagType("user")
.build();

Response<TagResults> response = service.detachTag(detachTagOptions).execute();
TagResults tagResults = response.getResult();
System.out.println(tagResults.toString());

resource_model = {'resource_id': serviceid_crn}

tag_results = global_tagging_service.detach_tag(
resources=[resource_model],
tag_names=['tag_test_1', 'tag_test_2'],
tag_type='user').get_result()

print(json.dumps(tag_results, indent=2))

resourceModel := &globaltaggingv1.Resource{
ResourceID: &serviceidCRN,
}

detachTagOptions := globalTaggingService.NewDetachTagOptions(
[]globaltaggingv1.Resource{resourceModel},
)
Grouping data by using tags 

Configure a logging agent to associate tags to all log records that it collects so that you can identify the agent's data quicker in the logging UI.



* You can define multiple tags per logging agent.
* You separate tags by using commas.
* The maximum number of characters that you can set to define multiple tags is 80 characters.
* You can view the tags per log record.
* You can filter data by using one or more tags through the All Tags menu in the logging UI.





 Adding tags to logs from a Kubernetes cluster 

Complete the following steps to add tags to a cluster:



1. Set up the cluster environment. Run the following commands:



1. Get the command to set the environment variable and download the Kubernetes configuration files.

ibmcloud ks cluster config --cluster <cluster_name_or_ID>

When the download of the configuration files is finished, a command is displayed that you can use to set the path to the local Kubernetes configuration file as an environment variable.
2. Copy and paste the command that is displayed in your terminal to set the KUBECONFIG environment variable.



2. Check the update strategy of the DaemonSet and choose whether to use kubectl apply or kubectl edit to modify the configuration file for the agent.

To check the update strategy, run the following command:

kubectl get ds/logdna-agent -o go-template='{{.spec.updateStrategy.type}}{{"n"}}'

If the update strategy is set to OnDelete or if you have the configuration file that is managed through a version control system, update your local configuration file and apply changes to the logging agent by using kubectl apply.

If the update strategy is set to RollingUpdate, you can update and apply changes to the logging agent by using kubectl edit.
3. Edit the logdna-agent-configmap.yaml file.

Update the configuration file by modifying the local copy. Note: You can also generate the configuration file of the agent by running the following command: