Skip to content

Commit 242f7ba

Browse files
committed
Update README and detection modules for clarity and validation improvements
1 parent a13504b commit 242f7ba

7 files changed

Lines changed: 9 additions & 16 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ If an image is detected as AI, a report like this will be made:
4646

4747
This app is open source under the BSD 3-Clause licence. The source code can be found [here](https://github.com/fsvreddit/image-moderator).
4848

49-
Interested in detections for things other than AI? Get in touch by messaging /u/fsv! The list of possibilities can be seen in Sightengine's documentation [here](https://sightengine.com/docs/models).
49+
Interested in detections for things not yet supported? Get in touch by messaging /u/fsv! The list of possibilities can be seen in Sightengine's documentation [here](https://sightengine.com/docs/models). It would be really useful if you could outline the kind of content you're looking to avoid on your subreddit.

src/detections/DetectDeepfake.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,7 @@ export class DetectDeepfake extends DetectionBase {
2121
name: ModuleSetting.Threshold,
2222
helpText: "App will report the post if the deepfake likelihood is greater than this percentage.",
2323
defaultValue: 80,
24-
onValidate: ({ value }) => {
25-
if (!value) {
26-
return;
27-
}
28-
if (value < 0 || value > 99) {
29-
return "Value must be between 0 and 99.";
30-
}
31-
},
24+
onValidate: event => this.validatePercentage(event),
3225
},
3326
];
3427

src/detections/DetectGenAI.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class DetectGenAI extends DetectionBase {
4040
}
4141

4242
if (aiLikelihood > this.getSetting<number>(ModuleSetting.Threshold, 80)) {
43-
return `AI Likelihood: ${aiLikelihood}%.`;
43+
return `AI Likelihood: ${aiLikelihood}%`;
4444
}
4545
}
4646

src/detections/DetectImageQuality.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,16 @@ export class DetectImageQuality extends DetectionBase {
3636
public detectProactive (sightEngineResponse: SightengineResponse): string | undefined {
3737
const quality = this.getQualityScore(sightEngineResponse);
3838
if (quality && quality < this.getSetting(ModuleSetting.QualityThreshold, 50)) {
39-
return `Image quality is low (${quality}).`;
39+
return `Image quality is low (${quality})`;
4040
}
4141
return undefined;
4242
}
4343

4444
public detectByMenu (sightEngineResponse: SightengineResponse): string | undefined {
4545
const quality = this.getQualityScore(sightEngineResponse);
4646
if (quality && quality < this.getSetting(ModuleSetting.QualityThreshold, 50)) {
47-
return `Image quality is low (${quality}).`;
47+
return `Image quality is low (${quality})`;
4848
}
49-
return "Image quality is acceptable.";
49+
return "Image quality is acceptable";
5050
}
5151
}

src/detections/DetectQRCodes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export class DetectQRCodeSpam extends DetectionBase {
7070
if (results.length > 0) {
7171
return results.join(", ");
7272
} else {
73-
return "No QR Code spam or social media links detected.";
73+
return "No QR Code spam or social media links detected";
7474
}
7575
}
7676
}

src/detections/DetectTextSpam.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { SightengineResponse } from "../checkSightEngineAPI.js";
55
export class DetectTextSpam extends DetectionBase {
66
public name = "TextSpam";
77
public friendlyName = "Text Spam Detection";
8-
public helpText = "Looks for text that may attempt to drive users externally, such as Telegram or Snapchat handles";
8+
public helpText = "Looks for text in images that may attempt to drive users externally, such as Telegram or Snapchat handles";
99
public sightengineType = "text-content";
1010

1111
public moduleSettings: SettingsFormField[] = [];

src/settings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const appSettings: SettingsFormField[] = [
2828
{
2929
type: "group",
3030
label: "Detect content in newly created posts",
31-
helpText: "Warning: you should be mindful of API usage, and set account age and karma thresholds to keep usage low.",
31+
helpText: "Warning: you should be mindful of API usage, and set account age and karma thresholds to keep usage low. Detection will only occur if at least one content type is chosen for proactive detection.",
3232
fields: [
3333
{
3434
type: "boolean",

0 commit comments

Comments
 (0)