[CWB] Question re: parallel corpora set up

Graham Ranger -- UAPV graham.ranger at univ-avignon.fr
Fri Jul 10 15:09:34 CEST 2026


Hi Stephanie,
Thanks, as always, for your quick and precise answers. One or two other 
follow-up questions below... but please do not feel obliged to answer, 
these are really just to help me understand things a little better, if 
you have a free minute.
Best wishes,
Graham.


Le 10/07/2026 à 08:43, Stephanie Evert a écrit :
>
> ⚠ Ce courrier est envoyé par un correspondant externe
>
> Hi Graham!
>
>> I have a quick question regarding parallel corpora set up. Does the 
>> cwb-align command actually do the alignment, as I understand it does, 
>> from the terminal messages, and, if so, is it possible to override 
>> the cwb alignment to impose one's own alignment?
>
> Correct. cwb-align ist the actual sentence aligner and does indeed use 
> a rather simplistic and old-fashioned algorithm. It outputs the 
> alignment in a text format (basically listing start/end corpus 
> positions of corresponding regions in source and target corpus), which 
> is then indexed with cwb-align-encode for use with CWB.
>
> Which means that you can "simply" generate your own alignment in this 
> text format and then run cwb-align-encode. You can also preview your 
> alignment with cwb-align-show first to check that you've got the 
> format right.
So as I understand this, given that my s tags are one-to-one 
correspondancse, it would be enough for me to upload an .align file 
reading 1 <TAB> 1, 2 <TAB> 2, etc.?

>
>> I'm asking because I remember reading that the cwb-align command was 
>> not a very efficient aligner, and so far I prefer to do the alignment 
>> myself in advance, and to give cwb-align files with exactly the same 
>> number of alignment fields (s tags). Despite this, I have the 
>> impression that the command can knock this initial, hand-checked 
>> alignment out of kilter, which is a shame, and so an override flag, 
>> if it existed, would be nice.
>
> If you have a pre-alignment (which might be at a different level than 
> sentences), you can indicate this to cwb-align, which will force the 
> aligner to only consider sentence correspondences that are consistent 
> with the pre-alignment. A trick I've sometimes used is to specify the 
> same s-attribute that encodes the pre-alignment (keep in mind that 
> there must be a single region for each pre-alignment block) as 
> alignment grid, which keeps cwb-align from making any changes.
Does this mean that, since I specify alignment on s tags in cwb-align, I 
should be getting what I want to achieve anyway?
>
> It is usually much easier, though, to use cwb-align-import from the 
> CWB/Perl modules. This script is intended to import an external 
> alignment given in terms of sentence IDs (which must be annotated in 
> the corpus via an s-attribute). From its documentation:
>
>> As an example, the line id_1 id_2 id_3 <TAB> id_2 id_3 [ <TAB> ... ] 
>> indicates that the first three sentences of the source corpus are 
>> aligned to the second and third sentence of the target corpus. 
>> Further TAB-delimited fields (e.g. specifying the confidence in an 
>> alignment bead) are silently ignored.
My pre-alignement is tagged <s> ... </s> which generally, but not 
always, correspond to sentences. As I understand it, I'd need to tag it 
<s id="1"> ... </s>, etc. Is that right? If so, could it just, 
trivially, be a question of added the "id" attribute incrementally to 
the already present "s" tags in order to run cwb-align-import with my 
pre-aligned material?
>
>
>> A related question: what does the "no alignments found" message most 
>> often mean? I'm setting up a three-way corpus English-French-Polish. 
>> The source text is English, the French and Polish texts are 
>> translations but, since the alignments are based on the English, I 
>> would like to be able to provide the option for searching in one 
>> translated corpus, and looking for the equivalent in the other 
>> translated corpus. So far, things work perfectly Eng-Fre and Eng-Pol 
>> but I get the "no alignments found" message when searching in 
>> "Fre-Pol" and yet I think I've set it all up identically...
>
> "no alignment found" is the message you get if a query match in your 
> source corpus isn't aligned to the target corpus. Since alignments 
> don't have to cover the corpus completely, this may well happen.
>
> However, if you always get the message, there's something wrong with 
> the Fre-Pol alignment. Perhaps a first step would be to use 
> cwb-align-decode on the French corpus to see which alignment beads you 
> actually have.
Thank you for this... I'll check again.
>
> Hope this helps,
> Stephanie
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://liste.sslmit.unibo.it/pipermail/cwb/attachments/20260710/d99b2256/attachment.html>


More information about the CWB mailing list