This repository has been archived by the owner on Aug 11, 2023. It is now read-only.
-
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.
- Loading branch information
1 parent
5a47898
commit d476c52
Showing
1 changed file
with
22 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,22 @@ | ||
package helpers | ||
|
||
import ( | ||
tf "github.com/galeone/tensorflow/tensorflow/go" | ||
tg "github.com/galeone/tfgo" | ||
) | ||
|
||
// CheckHTML uses machine learning to detect fake | ||
// websites such as pishing ones | ||
func CheckHTML(html string) float32 { | ||
model := tg.LoadModel("models/phishing", []string{"serve"}, nil) | ||
|
||
input, _ := tf.NewTensor(html) | ||
|
||
results := model.Exec([]tf.Output{ | ||
model.Op("StatefulPartitionedCall", 0), | ||
}, map[tf.Output]*tf.Tensor{ | ||
model.Op("serving_default_inputs_input", 0): input, | ||
}) | ||
|
||
return results[0].Value().(float32) | ||
} |