run final
This commit is contained in:
parent
02742a50fc
commit
68eb70e9b2
3
.idea/.gitignore
vendored
Normal file
3
.idea/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
13
.idea/inspectionProfiles/Project_Default.xml
Normal file
13
.idea/inspectionProfiles/Project_Default.xml
Normal file
@ -0,0 +1,13 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="PyPep8NamingInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true">
|
||||
<option name="ignoredErrors">
|
||||
<list>
|
||||
<option value="N802" />
|
||||
<option value="N803" />
|
||||
</list>
|
||||
</option>
|
||||
</inspection_tool>
|
||||
</profile>
|
||||
</component>
|
6
.idea/inspectionProfiles/profiles_settings.xml
Normal file
6
.idea/inspectionProfiles/profiles_settings.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<settings>
|
||||
<option name="USE_PROJECT_PROFILE" value="false" />
|
||||
<version value="1.0" />
|
||||
</settings>
|
||||
</component>
|
4
.idea/misc.xml
Normal file
4
.idea/misc.xml
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.8" project-jdk-type="Python SDK" />
|
||||
</project>
|
8
.idea/modules.xml
Normal file
8
.idea/modules.xml
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/retro_gap.iml" filepath="$PROJECT_DIR$/.idea/retro_gap.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
8
.idea/retro_gap.iml
Normal file
8
.idea/retro_gap.iml
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="PYTHON_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
6
.idea/vcs.xml
Normal file
6
.idea/vcs.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
10
Main.py
10
Main.py
@ -1,12 +1,14 @@
|
||||
import sys
|
||||
import numpy as np
|
||||
|
||||
log = []
|
||||
line = 0
|
||||
|
||||
unigrams = []
|
||||
unigramsF = {}
|
||||
|
||||
unigramKeys = 0
|
||||
unigramWords = 0
|
||||
line = 0
|
||||
log = []
|
||||
|
||||
|
||||
def makeUnigrams(unigrams):
|
||||
@ -16,7 +18,7 @@ def makeUnigrams(unigrams):
|
||||
unigrams.append(i[2:])
|
||||
|
||||
|
||||
def countWordsAndKeys(keys, words):
|
||||
def countWordsAndKeys(keys, words, unigrams):
|
||||
for u in unigrams:
|
||||
for i in range(0, len(u)):
|
||||
if u[i] not in unigramsF:
|
||||
@ -50,5 +52,5 @@ def logic(sortedUnigrams, val):
|
||||
|
||||
if __name__ == '__main__':
|
||||
makeUnigrams(unigrams)
|
||||
countWordsAndKeys(unigramKeys, unigramWords)
|
||||
countWordsAndKeys(unigramKeys, unigramWords, unigrams)
|
||||
logic(sorted(unigramsF.items(), key=lambda x: x[1], reverse=True), unigramWords + unigramKeys)
|
||||
|
19986
dev-0/out.tsv
Normal file
19986
dev-0/out.tsv
Normal file
File diff suppressed because it is too large
Load Diff
11628
dev-1/out.tsv
Normal file
11628
dev-1/out.tsv
Normal file
File diff suppressed because it is too large
Load Diff
14132
test-A/out.tsv
Normal file
14132
test-A/out.tsv
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user