Sample IMPACT hackathon workflow
Created: 2011-11-14 16:12:10
Last updated: 2012-06-19 10:28:42
Workflow that implements the Use Case for Group 2 at the IMPACT/Taverna hackathon.
What it does is to take the URL of a TIFF image and compute the Levenshtein difference between the OCR output of the uncompressed version with various ones compressed at various bit rates.
Preview
Run
Run this Workflow in the Taverna Workbench...
Workflow Components
Authors (1)
Titles (2)
Sample IMPACT hackathon workflow |
Sample IMPACT hackathon workflowq |
Descriptions (1)
Workflow that implements the Use Case for Group 2 at the IMPACT/Taverna hackathon.
What it does is to take the URL of a TIFF image and compute the Levenshtein difference between the OCR output of the uncompressed version with various ones compressed at various bit rates. |
Dependencies (0)
Inputs (3)
Name |
Description |
InputImage |
The URL of the input image.
The URL of the input image, as a _string_.
|
Rate |
Number of bits per pixel to use for compression
|
Language |
Language module to use with OCR engine (greatly improves the error rate across all bit-rates).
|
Processors (7)
Name |
Type |
Description |
Compute_Levenshtein_Distance |
beanshell |
Scriptint n = baseline.length();
int m = compressed.length();
if (n == 0) {
distance = m;
} else if (m == 0) {
distance = n;
} else {
int[] p = new int[n+1];
int[] d = new int[n+1];
int[] _d;
int i; int j;
char t_j;
int cost;
for (i = 0; i<=n; i++) {
p[i] = i;
}
for (j = 1; j<=m; j++) {
t_j = compressed.charAt(j-1);
d[0] = j;
for (i=1; i<=n; i++) {
cost = baseline.charAt(i-1)==t_j ? 0 : 1;
d[i] = Math.min(Math.min(d[i-1]+1, p[i]+1), p[i-1]+cost);
}
_d = p;
p = d;
d = _d;
}
distance = p[n];
} |
OCR_Original |
workflow |
|
OCR_Compressed |
workflow |
|
Compress_Image |
workflow |
|
Decompress_Image |
workflow |
|
Read_Text_File |
localworker |
ScriptBufferedReader getReader (String fileUrl) throws IOException {
InputStreamReader reader;
try {
reader = new FileReader(fileUrl);
}
catch (FileNotFoundException e) {
// try a real URL instead
URL url = new URL(fileUrl);
reader = new InputStreamReader (url.openStream());
}
return new BufferedReader(reader);
}
StringBuffer sb = new StringBuffer(4000);
BufferedReader in = getReader(fileurl);
String str;
String lineEnding = System.getProperty("line.separator");
while ((str = in.readLine()) != null) {
sb.append(str);
sb.append(lineEnding);
}
in.close();
filecontents = sb.toString();
|
Read_Text_File_2 |
localworker |
ScriptBufferedReader getReader (String fileUrl) throws IOException {
InputStreamReader reader;
try {
reader = new FileReader(fileUrl);
}
catch (FileNotFoundException e) {
// try a real URL instead
URL url = new URL(fileUrl);
reader = new InputStreamReader (url.openStream());
}
return new BufferedReader(reader);
}
StringBuffer sb = new StringBuffer(4000);
BufferedReader in = getReader(fileurl);
String str;
String lineEnding = System.getProperty("line.separator");
while ((str = in.readLine()) != null) {
sb.append(str);
sb.append(lineEnding);
}
in.close();
filecontents = sb.toString();
|
Beanshells (1)
Name |
Description |
Inputs |
Outputs |
Compute_Levenshtein_Distance |
|
baseline
compressed
|
distance
|
Outputs (6)
Name |
Description |
LevenshteinDistance |
|
baselineLog |
|
Compress_Image_Log |
|
EncodingScanningLog |
|
Compressed_Contents |
|
Original_Contents |
|
Datalinks (17)
Source |
Sink |
Read_Text_File:filecontents |
Compute_Levenshtein_Distance:compressed |
Read_Text_File_2:filecontents |
Compute_Levenshtein_Distance:baseline |
InputImage |
OCR_Original:InputImage |
Language |
OCR_Original:Language |
Decompress_Image:OutputImage |
OCR_Compressed:InputImage |
Language |
OCR_Compressed:Language |
Rate |
Compress_Image:CompressionRate |
InputImage |
Compress_Image:InputImage |
Compress_Image:OutputImage |
Decompress_Image:InputImage |
OCR_Compressed:OutputText |
Read_Text_File:fileurl |
OCR_Original:OutputText |
Read_Text_File_2:fileurl |
Compute_Levenshtein_Distance:distance |
LevenshteinDistance |
OCR_Original:Log |
baselineLog |
Compress_Image:Log |
Compress_Image_Log |
OCR_Compressed:Log |
EncodingScanningLog |
Read_Text_File:filecontents |
Compressed_Contents |
Read_Text_File_2:filecontents |
Original_Contents |
Uploader
License
All versions of this Workflow are
licensed under:
Version 1
(of 1)
Credits (1)
(People/Groups)
Attributions (0)
(Workflows/Files)
None
Shared with Groups (1)
Featured In Packs (0)
None
Log in to add to one of your Packs
Attributed By (0)
(Workflows/Files)
None
Favourited By (0)
No one
Statistics
Other workflows that use similar services
(0)
There are no workflows in myExperiment that use similar services to this Workflow.
Comments (1)
Log in to make a comment
Hello,
Would it be possible to know to password to try this workflow?
Thanks