Created
December 17, 2015 19:24
-
-
Save bobye/3c64c2a03a53ce17bfc0 to your computer and use it in GitHub Desktop.
create_ohsumed.sh
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
#!/bin/sh | |
#wget http://disi.unitn.it/moschitti/corpora/ohsumed-all-docs.tar.gz | |
#tar xvf ohsumed-all-docs.tar.gz | |
cd ohsumed-all | |
filename=ohsumed_clusters.txt | |
rm -f $filename | |
for category in C*; do | |
echo %%%$category >> $filename | |
for abstract in $category/*; do | |
tr '\n' ' ' < $abstract | ../tocorpus.pl >> $filename | |
done | |
done | |
mv $filename tmp.txt | |
awk '!seen[$0]++' tmp.txt > $filename # remove duplicate lines |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment