This document describes the specifications of a web service REST allowing to generate an output for the toolkit HTS to build French voices. The input of the web service can be a TextGrid (Praat format file) for the training and a text or a textgrid for the running of TTS.

All resources

For all ressources, we authorize the OPTIONS method that returns a list with the methods allowed for that resource.

Exemple

OPTIONS on the /textgrids ressource
# Request
OPTIONS /textgrids HTTP/1.1
Host: cental.uclouvain.be/elitehts/v1/

# Response
HTTP/1.1 204 No Content
Allow: GET, POST, OPTIONS

/textgrids

This resource corresponds to a textgrids directory

Media types: text/plain

Methods allowed : POST, OPTIONS

Méthode Exemple Description

POST

POST /textgrids

Record a new textgrid

Example

Recording a new textgrid
# Request
POST /textgrids HTTP/1.1
Host: cental.uclouvain.be/elitehts/v1/
Accept: application/xml
Content-Type: text/plain;charset=iso-8859-1

File type = "ooTextFile"
Object class = "TextGrid"

xmin = 0
xmax = 65.85
tiers? <exists>
size = 7
item []:
    item [1]:
        class = "IntervalTier"
        name = "pho"
        xmin = 0
        xmax = 65.85
        intervals: size = 542
        intervals [1]:
...


# Response
HTTP/1.1 201 Created
Location: http://cental.uclouvain.be/elitehts/v1/textgrids/:id

<resource>
  <status>created</status>
  <link rel="self" href="http://cental.uclouvain.be/elitehts/v1/textgrids/:id"/>
</resource>
Note

application/xml is the default format. To obtain a response in XML, it is not necessary to specify in the header of the request : Accept: application/xml.

In all cases, it is necessary to specify Content-Type: application/xml;charset=iso-8859-1 to allow at the server to know the format of the data that it receives.

/textgrids/:id

This resource is a textgrid

Media types: text/plain

Methods allowed : GET, DELETE, OPTIONS

Méthode Exemple Description

GET

GET /textgrids/:id

return the textgrid content

DELETE

DELETE /textgrids/:id

delete a textgrid

Example

Recovery of a textgrid
# Request
GET /textgrids/:id HTTP/1.1
Host: cental.uclouvain.be/elitehts/v1/
Accept: text/plain;charset=iso-8859-1


# Response
HTTP/1.1 200 OK
Content-Type: text/plain;charset=iso-8859-1

File type = "ooTextFile"
Object class = "TextGrid"

xmin = 0
xmax = 65.85
tiers? <exists>
size = 7
item []:
    item [1]:
        class = "IntervalTier"
        name = "pho"
        xmin = 0
        xmax = 65.85
        intervals: size = 542
        intervals [1]:
...
Deletion of a textgrid
# Request
DELETE /textgrids/:id HTTP/1.1
Host: cental.uclouvain.be/elitehts/v1/
Accept: application/xml

# Response
HTTP/1.1 204 No Content

/textgrids/:id/hts

This resource corresponds to the ouput HTS generated from a textgrid

media types: text/plain

methods allowed : GET, OPTIONS

méthode exemple description

GET

GET /textgrids/:id/hts

returns hts output (by default, mode train)

GET

GET /textgrids/:id/hts&mode=train

returns hts output to use for training

GET

GET /textgrids/:id/hts&mode=run

returns hts output to generate the synthesis

Example

recovery of the HTS output
# Request
GET /textgrids/:id/hts HTTP/1.1
Host: cental.uclouvain.be/elitehts/v1/
Accept: text/plain;charset=iso-8859-1


# Response
HTTP/1.1 200 OK
Content-Type: text/plain;charset=iso-8859-1

0 4694739 x^x-_+S=a@1_1/A:0_0_/B:0-1-1@1-1&1-1#0-0$0-0!0-1;0-1|_/C:1+1+3/D:x_0/E:MEDIUMPUNCT+1@1+1&0+0#0+1/F:PROPERNAME-3/G:0_0/H:1=1@0=22|NONE/I:14_5/J:90+51-23
4694739 6416635 x^_-S+a=R@1_3/A:0_1_1/B:1-1-3@1-3&0#0-0$0-0!0-2;1-13|a/C:0+0+2/D:MEDIUMPUNCT_1/E:PROPERNAME+3@1+5&0+4#1+1/F:PROPERNAME-2/G:1_1/H:14=5@1=21|F/I:0_2/J:90+51-23
6416635 7000000 _^S-a+R=l@2_2/A:0_1_1/B:1-1-3@1-3&0#0-0$0-0!0-2;1-13|a/C:0+0+2/D:MEDIUMPUNCT_1/E:PROPERNAME+3@1+5&0+4#1+1/F:PROPERNAME-2/G:1_1/H:14=5@1=21|F/I:0_2/J:90+51-23
7000000 7400000 S^a-R+l=@@3_1/A:0_1_1/B:1-1-3@1-3&0#0-0$0-0!0-2;1-13|a/C:0+0+2/D:MEDIUMPUNCT_1/E:PROPERNAME+3@1+5&0+4#1+1/F:PROPERNAME-2/G:1_1/H:14=5@1=21|F/I:0_2/J:90+51-23
7400000 7900000 a^R-l+@=R@1_2/A:1_1_3/B:0-0-2@2-2&0#1-0$1-0!1-1;1-12|@/C:1+0+3/D:MEDIUMPUNCT_1/E:PROPERNAME+3@1+5&0+4#1+1/F:PROPERNAME-2/G:1_1/H:14=5@1=21|NONE/I:0_2/J:90+51-23
7900000 8500313 R^l-@+R=w@2_1/A:1_1_3/B:0-0-2@2-2&0#1-0$1-0!1-1;1-12|@/C:1+0+3/D:MEDIUMPUNCT_1/E:PROPERNAME+3@1+5&0+4#1+1/F:PROPERNAME-2/G:1_1/H:14=5@1=21|NONE/I:0_2/J:90+51-23
8500313 8900000 l^@-R+w=a@1_3/A:0_0_2/B:1-0-3@3-1&0#1-0$1-0!2-1;2-11|a/C:1+0+1/D:MEDIUMPUNCT_1/E:PROPERNAME+3@1+5&0+4#1+1/F:PROPERNAME-2/G:1_1/H:14=5@1=21|H/I:0_2/J:90+51-23
...

/textgrids/:id/textgrid_hts

This resource corresponds to a textgrid with new annotation tiers containing NLP analysis from input textgrid.

media types: text/plain

Methods allowed : GET, OPTIONS

méthode exemple description

GET

GET /textgrids/:id/textgrid_hts

returns a textgrid with new tiers

Example

recovery of the output textgrid_hts
# Request
GET /textgrids/:id/hts HTTP/1.1
Host: cental.uclouvain.be/elitehts/v1/
Accept: text/plain;charset=iso-8859-1

# Response
HTTP/1.1 200 OK
Content-Type: text/plain;charset=iso-8859-1

File type = "ooTextFile"
Object class = "TextGrid"

xmin = 0
xmax = 65.85
tiers? <exists>
size = 7
item []:
    item [1]:
        class = "IntervalTier"
        name = "pho"
        xmin = 0
        xmax = 65.85
        intervals: size = 542
        intervals [1]:
...

/textgrids/:id/dls

This resource corresponds to the dls output (eLite format) containing NLP analysis from input textgrid.

media types: text/plain

methods allowed : GET, OPTIONS

méthode exemple description

GET

GET /textgrids/:id/dls

returns a dls output with NLP analysis

Example

recovery of the dls output
# Request
GET /textgrids/:id/hts HTTP/1.1
Host: cental.uclouvain.be/elitehts/v1/
Accept: text/plain;charset=iso-8859-1


# Response
Content-Type: text/plain;charset=iso-8859-1
HTTP/1.1 200 OK


[DLSTTS 2.6]
Name = eLite
NbWordin = 163
NbGram = 162
NbPhoneme = 542
NbF0 = 0
[Wordin]
Item 0
        Name = ~
        Nature = WORDIN_INSERT
        Position = 0
        Tags =
        Word = 0,1
Item 1
        Name = Charleroi
        Nature = WORDIN_WORDIN
        Position = 0
        Tags =
        Word = 1,1
Item 2
        Name = Efes
        Nature = WORDIN_WORDIN
        Position = 10
        Tags =
        Word = 2,1

...

/texts

This resource corresponds to a texts directory

Media types: text/plain

Methods allowed : POST, OPTIONS

Méthode Exemple Description

POST

POST /texts

record a text

Example

Recording of a text
# Request
POST /textgrids HTTP/1.1
Host: cental.uclouvain.be/elitehts/v1/
Accept: application/xml
Content-Type: text/plain;charset=iso-8859-1

Je fais un test de synthèse vocale.

# Response
HTTP/1.1 201 Created
Location: http://cental.uclouvain.be/elitehts/v1/texts/:id

<resource>
  <status>created</status>
  <link rel="self" href="http://cental.uclouvain.be/elitehts/v1/texts/:id"/>
</resource>

/texts/:id

This resource corresponds to a text

Media types: text/plain

Methods allowed : GET, DELETE, OPTIONS

Méthode Exemple Description

GET

GET /texts/:id

Return the text content

DELETE

DELETE /texts/:id

Delete a text

Example

Recovery of a text
# Request
GET /textgrids/:id HTTP/1.1
Host: cental.uclouvain.be/elitehts/v1/
Accept: text/plain;charset=iso-8859-1

# Response
HTTP/1.1 200 OK
Content-Type: text/plain;charset=iso-8859-1


Je fais un test de synthèse vocale.
Deletion of a text
# Request
DELETE /texts/:id HTTP/1.1
Host: cental.uclouvain.be/elitehts/v1/

# Response
HTTP/1.1 204 No Content

/texts/:id/hts

this resource corresponds to the ouput HTS generated from a textgrid

media types: text/plain

methods allowed : GET, OPTIONS

méthode exemple description

GET

GET /texts/:id/hts

returns hts output (by default, mode train)

GET

GET /texts/:id/hts&mode=train

returns hts output to use for training

GET

GET /texts/:id/hts&mode=run

returns hts output to generate the synthesis

Example

recovery of the HTS output
# Request
GET /texts/:id/hts HTTP/1.1
Host: cental.uclouvain.be/elitehts/v1/
Accept: text/plain;charset=iso-8859-1


# Response
HTTP/1.1 200 OK
Content-Type: text/plain;charset=iso-8859-1


0 4694739 x^x-_+S=a@1_1/A:0_0_/B:0-1-1@1-1&1-1#0-0$0-0!0-1;0-1|_/C:1+1+3/D:x_0/E:MEDIUMPUNCT+1@1+1&0+0#0+1/F:PROPERNAME-3/G:0_0/H:1=1@0=22|NONE/I:14_5/J:90+51-23
4694739 6416635 x^_-S+a=R@1_3/A:0_1_1/B:1-1-3@1-3&0#0-0$0-0!0-2;1-13|a/C:0+0+2/D:MEDIUMPUNCT_1/E:PROPERNAME+3@1+5&0+4#1+1/F:PROPERNAME-2/G:1_1/H:14=5@1=21|F/I:0_2/J:90+51-23
6416635 7000000 _^S-a+R=l@2_2/A:0_1_1/B:1-1-3@1-3&0#0-0$0-0!0-2;1-13|a/C:0+0+2/D:MEDIUMPUNCT_1/E:PROPERNAME+3@1+5&0+4#1+1/F:PROPERNAME-2/G:1_1/H:14=5@1=21|F/I:0_2/J:90+51-23
7000000 7400000 S^a-R+l=@@3_1/A:0_1_1/B:1-1-3@1-3&0#0-0$0-0!0-2;1-13|a/C:0+0+2/D:MEDIUMPUNCT_1/E:PROPERNAME+3@1+5&0+4#1+1/F:PROPERNAME-2/G:1_1/H:14=5@1=21|F/I:0_2/J:90+51-23
7400000 7900000 a^R-l+@=R@1_2/A:1_1_3/B:0-0-2@2-2&0#1-0$1-0!1-1;1-12|@/C:1+0+3/D:MEDIUMPUNCT_1/E:PROPERNAME+3@1+5&0+4#1+1/F:PROPERNAME-2/G:1_1/H:14=5@1=21|NONE/I:0_2/J:90+51-23
7900000 8500313 R^l-@+R=w@2_1/A:1_1_3/B:0-0-2@2-2&0#1-0$1-0!1-1;1-12|@/C:1+0+3/D:MEDIUMPUNCT_1/E:PROPERNAME+3@1+5&0+4#1+1/F:PROPERNAME-2/G:1_1/H:14=5@1=21|NONE/I:0_2/J:90+51-23
8500313 8900000 l^@-R+w=a@1_3/A:0_0_2/B:1-0-3@3-1&0#1-0$1-0!2-1;2-11|a/C:1+0+1/D:MEDIUMPUNCT_1/E:PROPERNAME+3@1+5&0+4#1+1/F:PROPERNAME-2/G:1_1/H:14=5@1=21|H/I:0_2/J:90+51-23
...

/texts/:id/textgrid_hts

This resource corresponds to a textgrid with new annotation tiers containing NLP analysis from input text.

media types: text/plain

Methods allowed : GET, OPTIONS

méthode exemple description

GET

GET /texts/:id/textgrid_hts

returns a textgrid with new tiers

Example

recovery of the textgrid_hts content
# Request
GET /textts/:id/hts HTTP/1.1
Host: cental.uclouvain.be/elitehts/v1/
Accept: text/plain;charset=iso-8859-1


# Response
Content-Type: text/plain;charset=iso-8859-1

HTTP/1.1 200 OK


File type = "ooTextFile"
Object class = "TextGrid"

xmin = 0
xmax = 65.85
tiers? <exists>
size = 7
item []:
    item [1]:
        class = "IntervalTier"
        name = "pho"
        xmin = 0
        xmax = 65.85
        intervals: size = 542
        intervals [1]:
...

/texts/:id/dls

This resource corresponds to the dls output (eLite format) containing NLP analysis from input text.

media types: text/plain

methods allowed : GET, OPTIONS

méthode exemple description

GET

GET /texts/:id/dls

returns a dls output with NLP analysis

Example

recovery of the dls file content
# Request
GET /texts/:id/hts HTTP/1.1
Host: cental.uclouvain.be/elitehts/v1/
Accept: text/plain;charset=iso-8859-1

# Response
Content-Type: text/plain;charset=iso-8859-1
HTTP/1.1 200 OK


[DLSTTS 2.6]
Name = eLite
NbWordin = 163
NbGram = 162
NbPhoneme = 542
NbF0 = 0
[Wordin]
Item 0
        Name = ~
        Nature = WORDIN_INSERT
        Position = 0
        Tags =
        Word = 0,1
Item 1
        Name = Charleroi
        Nature = WORDIN_WORDIN
        Position = 0
        Tags =
        Word = 1,1
Item 2
        Name = Efes
        Nature = WORDIN_WORDIN
        Position = 10
        Tags =
        Word = 2,1

...

Phone and GPOS list

Phone list for french

phone API example

_

silence

i

i

ville

e

e

réviser

E

ɛ

perle

a

a

balle

O

ɔ

bol

o

o

beau

u

u

fou

y

y

bulle

2

ø

veux

9

œ

seul

@

ə

revenir

e~

ɛ̃

pin

9~

œ̃

brun

a~

ɑ̃

manger

o~

ɔ̃

blonde

j

j

lien

w

w

oui

H

ɥ

fruit

p

p

perle

t

t

tenir

k

k

cabine

b

b

banane

d

d

docile

g

g

gondole

f

f

frein

s

s

servir

S

ʃ

chanter

v

v

venir

z

z

sirer

Z

ʒ

jouer

l

l

lire

R

ʁ

ramoner

m

m

manger

n

n

nier

N

ɲ

vigne

G

ŋ

parking

GPOS list for french

GPOS complete name

NOUN

Noun

PROPERNAME

Proper Name

ACRONYM

Acronyms

ADJ

Adjective

VERB

Verb

AUX

Auxiliary

INFINIT

Infinitive

PARTPASSE

Last Participle

PARTPRES

Present Participle

PRED

Predicate

DET

Determinant

DETEXCL

Exclamative Determinant

DETIND

Undefined Determinant

DETINT

Interrogative Determinant

DETPREP

Preposition/Determinant

PRON

Pronoun

PRONIND

Indefinite Pronoun

PRONPER

Personnal Pronoun

PRONDEM

Conclusive Pronoun

PRONREL

Relative Pronoun

PRONINT

Interrogative Pronoun

PRONPOS

Possessive Pronoun

PRONPERSJ

personal pronoun that can only be a subject

PRONPERCD

personal pronoun that can only be a direct complement

PRONPERCI

personal pronoun that can only be a indirect complement

ADV

Adverb

ADVN

Negation Adverb

ADVDEG

Degree Adverb

ADVINT

Interrogative Adverb

PREP

Preposition

CONJ

Conjunction

CONJCOOR

Coordinating Conjuction

CONJSUB

Subordinating Conjunction

INTERJ

Interjection

EUPHO

Euphonique

INTROD

Introducer

PREF

prefix in a word

FOREIGN

foreign word

FIELD

Number fields

NUM

Number

URI

Unified Resource Identifier

GNDATE

Date

TEL

Tel

TIME

Time

SYMBOL

Symbols (not char num or punct)

MONEY

Money

LIGHTPUNCT

Light punctuation (,)

MEDIUMPUNCT

Medium punctuation (; :)

ENDPUNCT

Final Punctuation (.)

PAROUV

Opening Bracket

PARFER

Closing Bracket

GUILLEMET

Double Quote

EXCLMARK

Exclamation Mark (!)

INTMARK

Interrogation Mark (?)

TIRET

Dash

Implementation of a client in Perl

The script below presents an example of client implementation with this input parameters :
(1) a file (.textgrid ou .txt)
(2) the type of the resource (textgrids ou texts)
(3) the output format desired (hts, dls or textgrid_hts)
(4) the mode to use (train ou run ; mod train is the default mode)

It realized the HTTP request below :
(1) post the resource content on the server
(2) return the resource options
(3) return the output desired
(4) delete the resource on the server

#!/usr/bin/perl
use strict;
use warnings;

use HTTP::Request;                      #to encode an HTTP request
use LWP::UserAgent;                     #class for web user agent (to send request and receive response)
use Data::Dumper;

my $ua = LWP::UserAgent->new;

if($#ARGV != 3)
{
        print "eLiteHTS_client.pl file(.txt or .textgrid) resource_type(texts or textgrids) output_format (hts, dls, textgrid_hts) mode (train or run)\n";
        exit(1);
}

my $server_uri_base = 'http://cental.uclouvain.be/elitehts/v1/';
#----------------------------------------------------------------------
#-- Read content file
#----------------------------------------------------------------------

print "Read content...\n";
my $input_file = $ARGV[0];
open(IN, $input_file);
binmode(IN, ':encoding(latin1)');

my $input_content = "";
while(my $line =<IN>)
{
        #print $line."\n";
        $input_content .= $line;
}

$input_content .= "\n";


#----------------------------------------------------------------------
#-- OPTIONS of /resource
#----------------------------------------------------------------------
print "Get resource options...\n";


my $res_type = $ARGV[1];

my $uri = $server_uri_base.$res_type;
print "URI ".$uri."\n";
my $req = HTTP::Request->new( 'OPTIONS' => $uri);
$req->header( 'Accept'       => 'application/xml' );
my $res = $ua->request($req);
if($res->code eq '204')
{
        print "Allow :". $res->header('Allow')."\n";
}


#----------------------------------------------------------------------
#-- POST the resource
#----------------------------------------------------------------------
print "Post a new resource...\n";

$uri = $server_uri_base.$res_type;
print "URI ".$uri."\n";
$req = HTTP::Request->new( 'POST' => $uri);
$req->header( 'Content-Type' => 'text/plain;charset=iso-8859-1' );
$req->header( 'Accept'       => 'application/xml' );
$req->content($input_content);

#-- Launch the request
my $res1 = $ua->request($req);

#-- If creation is not successful
if ( $res1->code ne '201' ) {
        print $res1->status_line."\n";
        print $res1->decoded_content."\n";
        exit(1);
}
else
{
        print $res1->decoded_content."\n";
}

#----------------------------------------------------------------------
#-- GET options of /resource/:id/
#----------------------------------------------------------------------
print "GET options of /resource/:id/...\n";

#-- Create a request and set the headers
$uri = $res1->header('Location');
print "URI POST ".$uri."\n";
$req = HTTP::Request->new( 'OPTIONS' => $uri);
$req->header( 'Accept'       => 'application/xml' );
my $res2 = $ua->request($req);
if($res2->code eq '204')
{
        print "Allow :". $res2->header('Allow')."\n";
}

#----------------------------------------------------------------------
#-- GET ouput content (hts, dls or textgrid_hts format)
#----------------------------------------------------------------------
print "GET ouput content...\n";
my $output_format = $ARGV[2];
my $mode = $ARGV[3];

#-- get resource location
$uri = $res1->header('Location');
$uri .= "/".$output_format."?mode=".$mode;
print "URI ".$uri."\n";
#-- Create a request and set the headers
$req = HTTP::Request->new('GET' => $uri);
$req->header('Accept' => 'text/plain');

#-- Launch the request
my $res3 = $ua->request($req);


#-- If retrieve is not successful
if ( $res3->code ne '200' ) {
        print $res3->status_line."\n";
        print $res3->decoded_content."\n";
        print exit(1);
}

#-- If retrieve is successful
print $res3->decoded_content;

#----------------------------------------------------------------------
#-- Delete ressource
#----------------------------------------------------------------------
print "DELETE resource...\n";

#-- get resource location
$uri = $res1->header('Location');
print "URI ".$uri."\n";

#-- Create a request and set the headers
$req = HTTP::Request->new('DELETE' => $uri);
$req->header('Accept' => 'application/xml');

#-- Launch the request
my $res4 = $ua->request($req);
print $res4->code."\n";
print $res4->decoded_content."\n";