-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stage2 QC: checking the match of the number of lines in input and out…
…put files
- Loading branch information
nvanva
committed
May 27, 2024
1 parent
7d79bae
commit 6cb9d28
Showing
3 changed files
with
15 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
HTMLDIR=$1 | ||
|
||
module purge; module load LUMI systools parallel | ||
find $HTMLDIR -name text.zst | parallel --eta -j250 "echo {//}; zstdcat {//}/metadata.zst|wc; zstdcat {//}/text.zst|wc; zstdcat {//}/lang.zst|wc" > text_lang_linecnts.log | ||
cat text_lang_linecnts.log |tr '\n' ' ' | sed 's!/user!\n/user!g' >text_lang_linecnts.tsv |
5 changes: 5 additions & 0 deletions
5
src/warc2text_runner/two/qualitycontrol/check_text_lang_linecnts.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import pandas as pd | ||
|
||
df=pd.read_csv('text_lang_linecnts.tsv', sep='\s+', header=None, names=['dir']+[f'{f}-{c}' for f in ('metadata','text','lang') for c in ('lines','words','bytes')]) | ||
print('\n'.join(df[df['metadata-lines'] != df['text-lines']]['dir'])) | ||
print('\n'.join(df[df['metadata-lines'] != df['lang-lines']]['dir'])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
# Feed content of text.zst to the stdin | ||
jq -c .traferr | sort | uniq -c |