Skip to content

Towards Controllable Text Generation: Multipart MIME #15

@AdamSobieski

Description

@AdamSobieski

Introduction

Expanding on #12, an alternative to the ideas presented in #14 is sketched, below, for discussion.

In the following sketch, a multipart MIME message is utilized, with a first part utilizing JSON-LD or RDF Turtle to interrelate the other parts, to represent content for software to use to create a prompt or agentic workflow for an artificial-intelligence system to use to generate natural-language content.

Sketch 1

The following sketch utilizes RFC 2392 URL schemes (mid:, cid:).

Mime-Version: 1.0
Message-ID: <12345678>
Content-Type: multipart/related; boundary="boundary-example"
Content-Metadata: <part1>

--boundary-example

Content-ID: <part1>
Content-Type: text/turtle

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix dnlg: <http://example.org/dnlg/> .

<mid:12345678> rdf:type dnlg:Input ;
               dnlg:speaker <cid:part2> ;
               dnlg:audience <cid:part3> ;
               dnlg:style <cid:part4> ;
               dnlg:content <cid:part5> ;
               dnlg:supplemental <cid:part6> ;
               dnlg:bibliography <cid:part7> .

--boundary-example

Content-ID: <part2>
Content-Type: text/plain
Content-Language: en

You are a helpful assistant knowledgeable in botany.

--boundary-example

Content-ID: <part3>
Content-Type: text/turtle

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix http: <http://www.w3.org/2011/http#> .

[] rdf:type http:Request ;
   http:headers (
     [ rdf:type http:HttpRequestHeader ;
       http:fieldName "Accept-Adaptation" ;
       http:fieldValue "<https://www.wikidata.org/entity/Q441>;q=0.75" ;
       http:headerElements (
         [ rdf:type http:HeaderElement ;
           http:elementName "<https://www.wikidata.org/entity/Q441>" ;
           http:params (
             [ rdf:type http:Parameter;
               http:paramName "q" ;
               http:paramValue "0.75"
             ]
           )
         ]
       )
     ]
     [ rdf:type http:HttpRequestHeader ;
       http:fieldName "Accept-Adaptation" ;
       http:fieldValue "<https://www.wikidata.org/entity/Q11351>;q=0.75" ;
       http:headerElements (
         [ rdf:type http:HeaderElement ;
           http:elementName "<https://www.wikidata.org/entity/Q11351>" ;
           http:params (
             [ rdf:type http:Parameter;
               http:paramName "q" ;
               http:paramValue "0.75"
             ]
           )
         ]
       )
     ]
   ) .

--boundary-example

Content-ID: <part4>
Content-Type: text/css

:root { ... }
.example { ... }
.example::concept('photosynthesis') { ... }

--boundary-example

Content-ID: <part5>
Content-Type: application/xhtml+xml
Content-Language: en

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <link rel="stylesheet" href="cid:part4">
  </head>
  <body>
    <ol>
      <li class="example">This is an outline of the content to adapt or personalize for an intended audience.</li>
      <li>The capability to style the markup suggests that markup should be used here instead of text.</li>
      <li>Also, some other markup-related features are shown below.
        <ol>
          <li>... <term>jargon</term> ...</li>
          <li>... <cite ref="cid:part7#biblio1 cid:part7#biblio2">...</cite> ...</li>
          <li>... <ask>What is the current weather in Townsville, Australia?</ask> ...</li>
          <li>Above, the answer is to be inserted into the content outline, replacing the question.</li>
          <li>...</li>
          <li>... <ask-sparql>...</ask-sparql> ...</li>
          <li>Above, the answer is also to be inserted into the content outline, replacing the SPARQL query.</li>
        </ol>
      </li>
    </ol>    
  </body>
</html>

--boundary-example

Content-ID: <part6>
Content-Type: application/ld+json

...

--boundary-example

Content-ID: <part7>
Content-Type: application/xml

<bibliography>
  <book id="biblio1" title="The big book of concepts" author="Murphy, Gregory" year="2004" ... />
  <book id="biblio2" title="A study of concepts" author="Peacocke, Christopher" year="1992" ... />
</bibliography>

--boundary-example--

Conclusion

Thank you for any feedback, comments, or ideas including with which to improve upon the above sketch.

If you would like to share any alternative approaches for representing content for software to use to create prompts or agentic workflows for generating natural-language content, in particular approaches mindful of adapting content for a variety of intended audiences, please feel free to do so in a new issue here in this forum.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions