Skip to content

Commit

Permalink
Update twitter_2017_taskC.py
Browse files Browse the repository at this point in the history
  • Loading branch information
rupakdas18 authored Apr 12, 2022
1 parent 70db7f0 commit 53e4922
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions twitter_2017_taskC.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,25 @@ def train(model, train_loader, val_loader, optimizer,scheduler):

train(model, train_dataloader, validation_dataloader, optimizer,scheduler)

import pandas as pd

# Display floats with two decimal places.
pd.set_option('precision', 2)

# Create a DataFrame from our training statistics.
df_stats = pd.DataFrame(data=training_stats)

# Use the 'epoch' as the row index.
df_stats = df_stats.set_index('epoch')

# A hack to force the column headers to wrap.
#df = df.style.set_table_styles([dict(selector="th",props=[('max-width', '70px')])])

# Display the table.
print(df_stats)



# Visualize the training and validation loss
import matplotlib.pyplot as plt
import seaborn as sns
Expand Down Expand Up @@ -293,6 +312,7 @@ def train(model, train_loader, val_loader, optimizer,scheduler):

# Load Test data
# Load the dataset into a pandas dataframe.
import pandas as pd
df = pd.read_csv("data/twitter-2016test-CE.txt", delimiter='\t', header=None, names=['id','topic','label','tweet'])

# Report the number of sentences.
Expand Down

0 comments on commit 53e4922

Please sign in to comment.