From 3cba9bb6a5a869ab548456fbea731f173c42b418 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Wed, 4 May 2022 01:38:21 +0200 Subject: [PATCH] state jurisdiction final --- .ipynb_checkpoints/run-checkpoint.ipynb | 16 ++++++++-------- .ipynb_checkpoints/run-checkpoint.py | 18 +++++++++--------- dev-0/out.tsv | 2 +- run.ipynb | 16 ++++++++-------- run.py | 18 +++++++++--------- test-A/out.tsv | 4 ++-- train/out.tsv | 4 ++-- 7 files changed, 39 insertions(+), 39 deletions(-) diff --git a/.ipynb_checkpoints/run-checkpoint.ipynb b/.ipynb_checkpoints/run-checkpoint.ipynb index 2bd4428..ea2e37f 100644 --- a/.ipynb_checkpoints/run-checkpoint.ipynb +++ b/.ipynb_checkpoints/run-checkpoint.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 56, + "execution_count": 64, "id": "8b07c9a5-e5cf-4cf9-a6d9-e784eb109fef", "metadata": {}, "outputs": [], @@ -12,7 +12,7 @@ }, { "cell_type": "code", - "execution_count": 57, + "execution_count": 65, "id": "fce94c21-6792-4938-bf2c-3f46ecf2f954", "metadata": {}, "outputs": [], @@ -21,12 +21,12 @@ " 'Hawaii', 'Idaho', 'Illinois', 'Indiana', 'Kansas', 'Kentucky', 'Louisiana', 'Maine', 'Maryland', \n", " 'Massachusetts', 'Michigan', 'Minnesota', 'Mississippi', 'Missouri', 'Nebraska', 'Nevada', 'New Hampshire', 'New Jersey', \n", " 'New Mexico', 'New York', 'North Carolina', 'North Dakota', 'Ohio', 'Oklahoma', 'Pennsylvania', 'Rhode Island', 'South Carolina', \n", - " 'South Dakota', 'Tennessee', 'Texas', 'Utah', 'Vermont', 'Virginia', 'Washington', 'West Virginia', 'Wisconsin', 'Wyoming']" + " 'South Dakota', 'Tennessee', 'Texas', 'Vermont', 'Virginia', 'Washington', 'West Virginia', 'Wisconsin', 'Wyoming']" ] }, { "cell_type": "code", - "execution_count": 58, + "execution_count": 66, "id": "eb1815f2-1876-4437-833a-ff22de81685e", "metadata": {}, "outputs": [], @@ -38,7 +38,7 @@ }, { "cell_type": "code", - "execution_count": 59, + "execution_count": 67, "id": "8729062d-87b8-4111-a216-8500334f54b6", "metadata": {}, "outputs": [], @@ -52,7 +52,7 @@ }, { "cell_type": "code", - "execution_count": 60, + "execution_count": 68, "id": "ea8069f7-de8e-454c-8eac-9fb7cc0df626", "metadata": {}, "outputs": [], @@ -68,7 +68,7 @@ }, { "cell_type": "code", - "execution_count": 61, + "execution_count": 69, "id": "ade45bfb-9eaa-4b2b-bba1-6cfcaf0a9ce6", "metadata": {}, "outputs": [], @@ -80,7 +80,7 @@ }, { "cell_type": "code", - "execution_count": 62, + "execution_count": 63, "id": "594a25a9-a0ce-4de9-82c8-df50a4ecac39", "metadata": {}, "outputs": [ diff --git a/.ipynb_checkpoints/run-checkpoint.py b/.ipynb_checkpoints/run-checkpoint.py index e61c46a..1623e9e 100644 --- a/.ipynb_checkpoints/run-checkpoint.py +++ b/.ipynb_checkpoints/run-checkpoint.py @@ -1,23 +1,23 @@ #!/usr/bin/env python # coding: utf-8 -# In[56]: +# In[64]: import re -# In[57]: +# In[65]: states = ['Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California', 'Colorado', 'Connecticut', 'Delaware', 'Florida', 'Georgia', 'Hawaii', 'Idaho', 'Illinois', 'Indiana', 'Kansas', 'Kentucky', 'Louisiana', 'Maine', 'Maryland', 'Massachusetts', 'Michigan', 'Minnesota', 'Mississippi', 'Missouri', 'Nebraska', 'Nevada', 'New Hampshire', 'New Jersey', 'New Mexico', 'New York', 'North Carolina', 'North Dakota', 'Ohio', 'Oklahoma', 'Pennsylvania', 'Rhode Island', 'South Carolina', - 'South Dakota', 'Tennessee', 'Texas', 'Utah', 'Vermont', 'Virginia', 'Washington', 'West Virginia', 'Wisconsin', 'Wyoming'] + 'South Dakota', 'Tennessee', 'Texas', 'Vermont', 'Virginia', 'Washington', 'West Virginia', 'Wisconsin', 'Wyoming'] -# In[58]: +# In[66]: def counter(text_in, query): @@ -25,7 +25,7 @@ def counter(text_in, query): return len(pattern.findall(text_in, re.IGNORECASE)) -# In[59]: +# In[67]: def state_prediction(text_in): @@ -35,7 +35,7 @@ def state_prediction(text_in): return max(state_dict, key=state_dict.get) -# In[60]: +# In[68]: def jurisdiction(path_in, path_out): @@ -47,7 +47,7 @@ def jurisdiction(path_in, path_out): file_out.close() -# In[61]: +# In[69]: jurisdiction('dev-0/in.tsv', 'dev-0/out.tsv') @@ -55,8 +55,8 @@ jurisdiction('train/in.tsv', 'train/out.tsv') jurisdiction('test-A/in.tsv', 'test-A/out.tsv') -# In[62]: +# In[63]: # get_ipython().system('jupyter nbconvert --to script run.ipynb') - +# diff --git a/dev-0/out.tsv b/dev-0/out.tsv index b101f89..ec43f20 100644 --- a/dev-0/out.tsv +++ b/dev-0/out.tsv @@ -63,7 +63,7 @@ jurisdiction=Ohio jurisdiction=California jurisdiction=New_York jurisdiction=California -jurisdiction=Utah +jurisdiction=Delaware jurisdiction=Delaware jurisdiction=Washington jurisdiction=Virginia diff --git a/run.ipynb b/run.ipynb index 2bd4428..ea2e37f 100644 --- a/run.ipynb +++ b/run.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 56, + "execution_count": 64, "id": "8b07c9a5-e5cf-4cf9-a6d9-e784eb109fef", "metadata": {}, "outputs": [], @@ -12,7 +12,7 @@ }, { "cell_type": "code", - "execution_count": 57, + "execution_count": 65, "id": "fce94c21-6792-4938-bf2c-3f46ecf2f954", "metadata": {}, "outputs": [], @@ -21,12 +21,12 @@ " 'Hawaii', 'Idaho', 'Illinois', 'Indiana', 'Kansas', 'Kentucky', 'Louisiana', 'Maine', 'Maryland', \n", " 'Massachusetts', 'Michigan', 'Minnesota', 'Mississippi', 'Missouri', 'Nebraska', 'Nevada', 'New Hampshire', 'New Jersey', \n", " 'New Mexico', 'New York', 'North Carolina', 'North Dakota', 'Ohio', 'Oklahoma', 'Pennsylvania', 'Rhode Island', 'South Carolina', \n", - " 'South Dakota', 'Tennessee', 'Texas', 'Utah', 'Vermont', 'Virginia', 'Washington', 'West Virginia', 'Wisconsin', 'Wyoming']" + " 'South Dakota', 'Tennessee', 'Texas', 'Vermont', 'Virginia', 'Washington', 'West Virginia', 'Wisconsin', 'Wyoming']" ] }, { "cell_type": "code", - "execution_count": 58, + "execution_count": 66, "id": "eb1815f2-1876-4437-833a-ff22de81685e", "metadata": {}, "outputs": [], @@ -38,7 +38,7 @@ }, { "cell_type": "code", - "execution_count": 59, + "execution_count": 67, "id": "8729062d-87b8-4111-a216-8500334f54b6", "metadata": {}, "outputs": [], @@ -52,7 +52,7 @@ }, { "cell_type": "code", - "execution_count": 60, + "execution_count": 68, "id": "ea8069f7-de8e-454c-8eac-9fb7cc0df626", "metadata": {}, "outputs": [], @@ -68,7 +68,7 @@ }, { "cell_type": "code", - "execution_count": 61, + "execution_count": 69, "id": "ade45bfb-9eaa-4b2b-bba1-6cfcaf0a9ce6", "metadata": {}, "outputs": [], @@ -80,7 +80,7 @@ }, { "cell_type": "code", - "execution_count": 62, + "execution_count": 63, "id": "594a25a9-a0ce-4de9-82c8-df50a4ecac39", "metadata": {}, "outputs": [ diff --git a/run.py b/run.py index e61c46a..1623e9e 100644 --- a/run.py +++ b/run.py @@ -1,23 +1,23 @@ #!/usr/bin/env python # coding: utf-8 -# In[56]: +# In[64]: import re -# In[57]: +# In[65]: states = ['Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California', 'Colorado', 'Connecticut', 'Delaware', 'Florida', 'Georgia', 'Hawaii', 'Idaho', 'Illinois', 'Indiana', 'Kansas', 'Kentucky', 'Louisiana', 'Maine', 'Maryland', 'Massachusetts', 'Michigan', 'Minnesota', 'Mississippi', 'Missouri', 'Nebraska', 'Nevada', 'New Hampshire', 'New Jersey', 'New Mexico', 'New York', 'North Carolina', 'North Dakota', 'Ohio', 'Oklahoma', 'Pennsylvania', 'Rhode Island', 'South Carolina', - 'South Dakota', 'Tennessee', 'Texas', 'Utah', 'Vermont', 'Virginia', 'Washington', 'West Virginia', 'Wisconsin', 'Wyoming'] + 'South Dakota', 'Tennessee', 'Texas', 'Vermont', 'Virginia', 'Washington', 'West Virginia', 'Wisconsin', 'Wyoming'] -# In[58]: +# In[66]: def counter(text_in, query): @@ -25,7 +25,7 @@ def counter(text_in, query): return len(pattern.findall(text_in, re.IGNORECASE)) -# In[59]: +# In[67]: def state_prediction(text_in): @@ -35,7 +35,7 @@ def state_prediction(text_in): return max(state_dict, key=state_dict.get) -# In[60]: +# In[68]: def jurisdiction(path_in, path_out): @@ -47,7 +47,7 @@ def jurisdiction(path_in, path_out): file_out.close() -# In[61]: +# In[69]: jurisdiction('dev-0/in.tsv', 'dev-0/out.tsv') @@ -55,8 +55,8 @@ jurisdiction('train/in.tsv', 'train/out.tsv') jurisdiction('test-A/in.tsv', 'test-A/out.tsv') -# In[62]: +# In[63]: # get_ipython().system('jupyter nbconvert --to script run.ipynb') - +# diff --git a/test-A/out.tsv b/test-A/out.tsv index 06f674e..f5797b4 100644 --- a/test-A/out.tsv +++ b/test-A/out.tsv @@ -106,9 +106,9 @@ jurisdiction=California jurisdiction=Connecticut jurisdiction=Maryland jurisdiction=Delaware -jurisdiction=Utah +jurisdiction=Alabama jurisdiction=California -jurisdiction=Utah +jurisdiction=Nevada jurisdiction=Colorado jurisdiction=Delaware jurisdiction=New_York diff --git a/train/out.tsv b/train/out.tsv index d80650b..d2c86ad 100644 --- a/train/out.tsv +++ b/train/out.tsv @@ -92,7 +92,7 @@ jurisdiction=Alabama jurisdiction=Delaware jurisdiction=Delaware jurisdiction=Connecticut -jurisdiction=Utah +jurisdiction=Alabama jurisdiction=Texas jurisdiction=Delaware jurisdiction=Ohio @@ -147,7 +147,7 @@ jurisdiction=Delaware jurisdiction=Delaware jurisdiction=Massachusetts jurisdiction=Massachusetts -jurisdiction=Utah +jurisdiction=Alabama jurisdiction=Washington jurisdiction=Texas jurisdiction=California