Jump to content

Luzapena: Wikispeech

From mediawiki.org
This page is a translated version of the page Extension:Wikispeech and the translation is 95% complete.
Hau da Wikispeech instalatzeko eta konfiguratzeko dokumentazioa. Nola erabili jakiteko laguntza bila bazabiltza, ikusi Help:Extension:Wikispeech .
MediaWiki extensions manual
Wikispeech
Release status: beta
Implementation Page action , Ajax, API , Special page , Database
Description Orriko testua ozen irakurtzen du, testutik ahotserako teknologia erabiliz.
Author(s) Sebastian Berlin, André Costa, Viktoria Hillerud, Igor Leturia and Karl Wettin
Latest version 0.1.15 (2026-05-07)
MediaWiki >= 1.43
Database changes Yes
  • $wgWikispeechSpeechoidUrl
  • $wgWikispeechSpeechoidHaproxyFrontendSvName
  • $wgWikispeechSpeechoidHaproxyOverloadFactor
  • $wgWikispeechRemoveTags
  • $wgWikispeechSpeechoidHaproxyStatsUrl
  • $wgWikispeechSymbolSetUrl
  • $wgWikispeechUtteranceFileBackendContainerName
  • $wgWikispeechKeyboardShortcuts
  • $wgWikispeechSpeechoidResponseTimeoutSeconds
  • $wgWikispeechUtteranceUseSwiftFileBackendExpiring
  • $wgWikispeechSpeechoidHaproxyQueueUrl
  • $wgWikispeechNamespaces
  • $wgWikispeechSpeechoidHaproxyBackendPxName
  • $wgWikispeechEditLexiconAutoLogin
  • $wgWikispeechListenMaximumInputCharacters
  • $wgWikispeechPronunciationLexiconConfiguration
  • $wgWikispeechUtteranceTimeToLiveDays
  • $wgWikispeechUseTextFilters
  • $wgWikispeechSegmentBreakingTags
  • $wgWikispeechFeedbackPage
  • $wgWikispeechContentSelector
  • $wgWikispeechListenMetricsJournalFile
  • $wgWikispeechMinimumMinutesBetweenFlushExpiredUtterancesJobs
  • $wgWikispeechSpeechRates
  • $wgWikispeechSpeechoidHaproxyFrontendPxName
  • $wgWikispeechFlushUtterances
  • $wgWikispeechUtteranceFileBackendName
  • $wgWikispeechSpeechoidHaproxyBackendSvName
  • $wgWikispeechAllowConsumerEdits
  • $wgWikispeechListenDoJournalMetrics
  • $wgWikispeechVoices
  • $wgWikispeechProducerMode
  • $wgWikispeechReportPronunciationUrl
  • $wgWikispeechSkipBackRewindsThreshold
  • $wgWikispeechHelpPage
  • wikispeech-listen
  • wikispeech-read-lexicon
  • wikispeech-edit-lexicon
  • wikispeech-edit-lexicon-raw
Licence GNU General Public License 2.0 or later
Download
Example
Translate the Wikispeech extension if it is available at translatewiki.net
Vagrant role wikispeech
Issues Open tasks · Report a bug

Wikispeech proiektuaren helburua kode irekiko testutik ahotserako tresna bat sortzea da, hainbat arrazoirengatik irakurtzeko zailtasunak dituzten pertsonentzat Wikimediaren proiektuak irisgarriago egiteko. Wikispeech MediaWikiren luzapen gisa eskuragarri egongo da. Informazio gehiago on the project page aurki daiteke; orri hau Wikispeech luzapenari berari buruzkoa baino ez da.

Speechoid

Wikispeecheko osagaien arteko ohiko elkarreragin batzuk erakusten dituen diagrama.

Dokumentazioa

Instalatzeko jarraibideak

Build and publish Docker images

Luzapenak Speechoid izeneko zerbitzu bat erabiltzen du TTS eragiketak egiteko, hala nola enuntziatuen audioa sortzeko. Speechoidek zerbitzari nagusi bat, lexiko-zerbitzari bat, TTS motorrak eta hizkuntza jakin batzuetarako beharrezkoak izan daitezkeen osagai gehigarriak ditu.

Testu-zati bat erreproduzitzeko prestatzeko, luzapenak eskaera bat bidaltzen dio zerbitzuari. Eskaera horrek testu-zatia, haren hizkuntza eta erabili beharreko ahotsa zehazten ditu. Zerbitzuak lexiko bat eta instalatutako TTS motorretako bat erabiltzen ditu testua prozesatzeko, erabilitako ahotsaren arabera. Audioa sortu ondoren, erantzun bat bidaltzen da audio-datuekin eta testua nabarmentzea eta zatiak saltatzea ahalbidetuko duen informazioarekin batera. Ondoren, luzapenak informazio hori erabiltzen du testu-zatia erabiltzaileari erreproduzitzeko, eta prozesua hurrengo testu-zatiekin errepikatzen da, behar den neurrian.

Wikispeech zerbitzari nagusia

Erregistroa

Zerbitzari nagusiak web API bat du, eta ahotsa sortzeko amaiera-puntu bat barne hartzen du. Azpian zerrendatutako zerbitzarien arteko barne-komunikazioa kudeatzen du.

Pronlex

Erregistroa

API propioa duen lexiko-zerbitzaria. Lexikoko sarrerei buruzko informazioa gordetzen du, eta sarrera horiek bilatzeko eta kudeatzeko amaiera-puntuak ditu. Testu-zati bat prozesatzean, hitzak lexikoan bilatzen dira, eta bat datorren sarrerarik badago, hura erabiltzen da ahoskerarako.

TTS motorrak

Zerbitzariak hainbat TTS motor erabiltzeko aukera ematen du. Testu-zati jakin baterako zein erabiltzen den eskaeran adierazitako ahotsaren araberakoa da.

MaryTTS

Erregistroa

Arabiera, ingelesa eta suediera onartzen ditu.

Osagai gehigarriak

Mishkal

Erregistroa

Arabierazko testua bokalizatzeko erabiltzen da.

Symbolset

Erregistroa

Symbolset phonetic symbol sets eta sinbolo multzo eta hizkuntza desberdinen arteko mapatzaileak/bihurgailuak kudeatzeko biltegi bat da.

Instalazioa

If you want to download a specific version of Wikispeech go to the archive and choose which version you want to download. Latest version: 0.1.15.

If using this way of downloading, you will not get the base folder Wikispeech. Please create the Wikispeech folder and then put the files inside it.


  • Download and move the extracted Wikispeech folder to your extensions/ directory.
    Developers and code contributors should install the extension from Git instead, using:
    cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Wikispeech
    
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'Wikispeech' );
    
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Speechoid konfiguratzea

Wikispeech luzapenak Speechoid behar du audioa sortzeko. Speechoid instalatzeko jarraibide zehatzak Installing Speechoid orrian aurki daitezke.

Oinarrizko konfigurazioa

Wikispeech luzapena Speechoid-ekin komunikatu ahal izateko, zerbitzuaren URLa zehaztu behar duzu. Horretarako, gehitu honako lerro hau LocalSettings.php -en:

$wgWikispeechSpeechoidUrl = 'URL';

URL zure Speechoid instantziaren URLa da.

You will also need to create a folder under /images in the MediaWiki repo called wikispeech_utterances, where the utterances will be stored.

Ekoizle gisa exekutatzea

If you want use your wiki to enable Wikispeech on other wikis you can enable "producer mode". One use case for this is to run Wikispeech as a gadget on other wikis.

Normally Wikispeech gets the text to synthesise from pages on the wiki it's installed on. If WikispeechProducerMode is true the wikispeech-listen action can take the parameter consumer-url. consumer-url should be set to the script path of the consumer wiki, e.g. for this wiki https://www.mediawiki.org/w. When the request is made Wikispeech will get the content from the consumer wiki and synthesise as normal. The utterance is stored with the extra parameter wsu_remote_wiki_hash in the database to keep track of which wiki it was generated from.

To allow users from a consumer wiki to log in on the producer wiki you can use OAuth. Make sure that Extension:OAuth is installed on the consumer wiki and add an OAuth consumer. Install Extension:WSOAuth on the producer wiki and add an OAuth provider.

To enable Wikispeech with a gadget or user script see Help:Extension:Wikispeech#As gadget or user script. If the config option WikispeechAllowConsumerEdits is true an edit button is added to the player on the consumer wiki. This will take the user to the lexicon editor on the producer.

Troubleshooting

During installation, unexpected issues may occur. This page collects known problems encountered in the past to assist with future troubleshooting: Extension:Wikispeech/Troubleshooting

Synthesizing system messages

Wikispeech provides support for synthesizing predefined MediaWiki messages, such as interface texts and error messages. These messages are synthesized ahead of time using a maintenance script and stored for access during runtime.

You should run this script:

  • When first installing the extension.
  • After upgrading the extension (as new messages may be introduced).
  • After changes of the available voices or modified voice configuration.
  • If messages have changed due to updates in MediaWiki core or other extensions.

Running the script ensures that messages are pre-synthesized in advance, avoiding runtime delays and errors.

To synthesize system messages, run the following maintenance script:

php maintenance/run.php ./extensions/Wikispeech/maintenance/preSynthesizeMessages.php -l <language>

Parameter -l (language) must be set, and if no voice parameter (-v) is given, then the default voice for the specific language will be used.


Konfigurazio-aukeren zerrenda osoa

Aukera Ezbeharreko balioa Dokumentazioa
WikispeechSpeechoidUrl
""
Speechoid zerbitzurako erabili beharreko URLa.
WikispeechSymbolSetUrl
""
Sinbolo multzoen zerbitzurako erabili beharreko URLa.
WikispeechSpeechoidResponseTimeoutSeconds
null
Speechoiden HTTP erantzunaren zain egoteko segundo kopuru lehenetsia. Balio faltsua emanez gero, MediaWikiren balio lehenetsia erabiliko da.
WikispeechListenMaximumInputCharacters
2048
Speechoid zerbitzura bidalitako sarrerako testuak (segmentu batek) izan dezakeen gehieneko karaktere kopurua.
WikispeechRemoveTags
{
    "span": "mw-editsection",
    "sup": "reference",
    "div": [
        "toc",
		"shortdescription"
    ]
}
Erabat ezabatu beharreko HTML etiketen mapa; hau da, haien eduki guztia ere ezabatu behar da. Gakoak etiketen izenak dira, eta balioek etiketa bat ezabatu behar den ala ez zehazten dute, honela:
  • true bada, mota horretako etiketa guztiak ezabatu.
  • Array bat bada, ezabatu arrayko kateetako edozeinekin bat datorren klasea duten etiketak.
  • Balioa faltsua bada, mota horretako etiketak ez dira ezabatuko. Hau "LocalSettings.php"-en erabil daiteke irizpide lehenetsiak gainidazteko.
WikispeechSegmentBreakingTags
[
    "h1",
    "h2",
    "h3",
    "h4",
    "h5",
    "h6",
    "p",
    "br",
    "li",
    "th",
    "td"
]
Testua segmentutan banatuko duten HTML etiketak. Horrek bermatzen du, adibidez, amaieran puntuazio-markarik ez duen goiburuko testua ez dela aurreko paragrafoko testu-edukiaren segmentu berean elkartuko.
WikispeechNamespaces
[
    0
]
Wikispeech aktibatuta duten namespace indizeen zerrenda.
WikispeechKeyboardShortcuts
{
    "playStop": {
        "key": 13,
        "modifiers": [
            "alt",
            "shift"
        ]
    },
    "skipAheadSentence": {
        "key": 39,
        "modifiers": [
            "alt",
            "shift"
        ]
    },
    "skipBackSentence": {
        "key": 37,
        "modifiers": [
            "alt",
            "shift"
        ]
    },
    "skipAheadWord": {
        "key": 40,
        "modifiers": [
            "alt",
            "shift"
        ]
    },
    "skipBackWord": {
        "key": 38,
        "modifiers": [
            "alt",
            "shift"
        ]
    }
}
Wikispeech komandoetarako lasterbideak. Lasterbide bakoitzak sakatutako tekla (tekla-kode gisa[1]) eta tekla aldatzaileak (ctrl, alt edo shift) zehazten ditu.
WikispeechSkipBackRewindsThreshold
3.0
Testu-zati bat denbora hori baino gehiagoz erreproduzitu bada (segundotan), atzera egitean uneko testu-zatiaren hasierara itzuliko da, aurreko testu-zatira joan beharrean.
WikispeechHelpPage
"Help:Wikispeech"
Wikispeecheko laguntza orria. Zehaztuta badago, erabiltzailea hona eramateko botoi bat gehitzen da erreproduzigailuaren botoien ondoan.
WikispeechFeedbackPage
"Wikispeech feedback"
Wikispeechi buruzko iritzia emateko orria Zehaztuta badago, erabiltzailea hona eramateko botoi bat gehitzen da erreproduzigailuaren botoien ondoan.
WikispeechContentSelector
"#mw-content-text"
Orriko testua duen elementuaren hautatzailea. Barnean erabiltzen da, baina MediaWikiren bertsioaren arabera alda daiteke.
WikispeechVoices
{
    "ar": [
        "ar-nah-hsmm"
    ],
    "en": [
        "dfki-spike-hsmm",
        "cmu-slt-hsmm"
    ],
    "sv": [
        "stts_sv_nst-hsmm"
    ]
}
Hizkuntza bakoitzerako erregistratutako ahotsak. Speechoid-ek sistemaren ahots lehenetsia zehazten ez badu, hizkuntza horretarako erregistratutako lehen ahotsa erabiliko da.
WikispeechMinimumMinutesBetweenFlushExpiredUtterancesJobs
30
Testu-zatien biltegitik iraungitako testu-zatiak automatikoki ezabatzen dituzten lanak ilaran jartzearen arteko gutxieneko minutu kopurua. Lana testu-zati berri bat sortzean jarriko da ilaran, aurreko aldiz lana ilaran jarri zenetik behar adina minutu igaro badira. Desgaitu ezabatze automatikoa balio faltsu bat ezarriz (0, false, null, etab.). Ezabatze-lana maizegi exekutatzea saihesteko, ikus MW job documentation.
WikispeechUtteranceTimeToLiveDays
31
Testu-zati bat testu-zatien biltegitik automatikoki ezabatu aurretik gutxienez zenbat egunez gordeko den. Gutxi gorabehera, sintetizatutako testuaren cachea ezabatzeko ezarpena. Balio hori baxuegi ezarriz gero, diskoan lekua aurreztuko da, baina maiz eskatzen diren testu-segmentuak sarriago sintetizatu beharko dira berriro, CPU baliabide gehiago erabiliz. Balio hori altuegi ezarriz gero, ahots-sintesiaren hobekuntzak eragotziko dira. Balio hori 0an ezarriz gero, praktikan cachea desgaituko da, eta testu-zati guztiak ahalik eta lasterren ezabatuko dira.
WikispeechUtteranceFileBackendName
""
Testu-zatien audio- eta metadatu-fitxategietarako erabiltzen den LocalSettings.php-n definitutako FileBackend taldea. LocalSettings.php-n definituta ez badago, aldi baterako direktorio batekin lan egingo duen FSBackend bat sortuko da. Ikus erregistroko abisuak bide zehatza jakiteko.
WikispeechUtteranceFileBackendContainerName
"wikispeech_utterances"
Testu-zatien audio- eta metadatu-fitxategietarako FileBackend-en erabiltzen den edukiontziaren izena.
WikispeechUtteranceUseSwiftFileBackendExpiring
false
Fitxategien backenda Swift bada eta balio hori true gisa ezarrita badago, Wikispeech-ek 'X-Delete-After' goiburua ezarriko du Swift-en fitxategiak sortzean, eta testu-zatiak ezabatzeko mekanismoak ez du delete komandoa exekutatuko Swift-en. Hau da, testu-zatien benetako ezabaketa Swift geruzara pasatzen da. Horrek zentzua izan dezan, Swift fitxategien backenda goiburu horiek onartzeko konfiguratu behar da. Hori nola egin jakiteko informazio gehiago lortzeko, ikus https://docs.openstack.org/swift/latest/overview_expiring_objects.html. Wikispeech-ek funtzio hori ofizialki onartuko du MediaWikiren 1.35 bertsioaren ondorengo lehen LTS bertsiotik aurrera (hau da, ziurrenik 1.39 bertsiotik aurrera).
WikispeechPronunciationLexiconConfiguration
"Wiki+Speechoid"
Ahoskera-lexikoa nola gordetzen den eta nola atzitzen den kontrolatzen du. 'Speechoid' katearen parte izan behar da ahots-sintesian eragina izan dezan. Balio posibleak hauek dira: 'Speechoid', Speechoid-eko azpiko lexikora soilik sartzeko. Ez dago berrikuspen historialik. 'Wiki+Speechoid', NS_PRONUNCIATION_LEXICON-n artikulu gisa gordetako lexikora sartzeko, berrikuspen-historiarako eta Speechoid-era pasatzeko. 'Wiki', NS_PRONUNCIATION_LEXICON-n artikulu gisa gordetako lexikora soilik sartzeko. 'Cache', MediaWikiren WAN cacheko aldi baterako biltegiratzea. Garapenerako bakarrik. 'Cache+Speechoid', WAN cacheko aldi baterako biltegiratzea, Speechoidera pasatua. Garapenerako bakarrik.
WikispeechProducerMode
false
Run Wikispeech in producer mode. This allows other wikis (consumers) to use this wiki to generate utterances. When an API requests includes the parameter `consumer-url`, page content is retrieved from the consumer wiki on that URL.
WikispeechAllowConsumerEdits
false
When true, an edit button is added to the toolbar that leads to the edit lexicon page on the producer wiki.
WikispeechEditLexiconAutoLogin
false
When true, redirect the user to login page if they visit the edit lexicon page and is not logged in.
WikispeechFlushUtterances
false
Mainly for development testing. When true, utterances are flushed when the page is loaded.
WikispeechHelpPage
"https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Extension:Wikispeech"
Help page for Wikispeech. If defined, a button that takes the user here is added next to the player buttons.

CSS

Hau garatzaileak ez direnentzat interesgarrienak diren CSS arauen azpimultzo bat da.

Aukeratzailea Ezbeharreko balioak Dokumentazioa
.ext-wikispeech-highlight-sentence
background-color: rgb( 200, 170, 255 );
Une horretan irakurtzen ari den esaldiaren nabarmentze bisuala.
.ext-wikispeech-highlight-word
background-color: rgb( 255, 200, 140 );
Une horretan irakurtzen ari den hitzaren nabarmentze bisuala.

Erreferentziak