From f6d2141a480dd6b5b8ee0e48d43bb64773232791 Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Tue, 26 Mar 2024 23:38:14 -0600 Subject: add header ids --- docs/posts/2019-12-22-Fake-News-Detector.html | 30 +++++++++++++-------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'docs/posts/2019-12-22-Fake-News-Detector.html') diff --git a/docs/posts/2019-12-22-Fake-News-Detector.html b/docs/posts/2019-12-22-Fake-News-Detector.html index 17ecaa1..a7216aa 100644 --- a/docs/posts/2019-12-22-Fake-News-Detector.html +++ b/docs/posts/2019-12-22-Fake-News-Detector.html @@ -6,13 +6,13 @@ - Building a Fake News Detector with Turicreate + id="building-a-fake-news-detector-with-turicreate">Building a Fake News Detector with Turicreate - - + Building a Fake News Detector with Turicreate" /> + Building a Fake News Detector with Turicreate" /> @@ -44,20 +44,20 @@
-

Building a Fake News Detector with Turicreate

+

Building a Fake News Detector with Turicreate

In this tutorial we will build a fake news detecting app from scratch, using Turicreate for the machine learning model and SwiftUI for building the app

Note: These commands are written as if you are running a jupyter notebook.

-

Building the Machine Learning Model

+

Building the Machine Learning Model

-

Data Gathering

+

Data Gathering

To build a classifier, you need a lot of data. George McIntire (GH: @joolsa) has created a wonderful dataset containing the headline, body and whether it is fake or real. Whenever you are looking for a dataset, always try searching on Kaggle and GitHub before you start building your own

-

Dependencies

+

Dependencies

I used a Google Colab instance for training my model. If you also plan on using Google Colab then I recommend choosing a GPU Instance (It is Free) This allows you to train the model on the GPU. Turicreate is built on top of Apache's MXNet Framework, for us to use GPU we need to install @@ -72,7 +72,7 @@ a CUDA compatible MXNet package.

If you do not wish to train on GPU or are running it on your computer, you can ignore the last two lines

-

Downloading the Dataset

+

Downloading the Dataset

!wget -q "https://github.com/joolsa/fake_real_news_dataset/raw/master/fake_or_real_news.csv.zip"
@@ -80,7 +80,7 @@ a CUDA compatible MXNet package.

-

Model Creation

+

Model Creation

import turicreate as tc
@@ -100,14 +100,14 @@ a CUDA compatible MXNet package.

-

Splitting Dataset

+

Splitting Dataset

train, test = dataSFrame.random_split(.9)
 
-

Training

+

Training

model = tc.text_classifier.create(
@@ -132,7 +132,7 @@ a CUDA compatible MXNet package.

-

Testing the Model

+

Testing the Model

est_predictions = model.predict(test)
@@ -165,7 +165,7 @@ a CUDA compatible MXNet package.

-

Exporting the Model

+

Exporting the Model

model_name = 'FakeNews'
@@ -178,9 +178,9 @@ a CUDA compatible MXNet package.

Link to Colab Notebook

-

Building the App using SwiftUI

+

Building the App using SwiftUI

-

Initial Setup

+

Initial Setup

First we create a single view app (make sure you check the use SwiftUI button)

-- cgit v1.2.3