Sanatbek_Matlatipov
commited on
Commit
·
a0a398d
1
Parent(s):
a601a82
Loading script is updated
Browse files- .gitignore +117 -0
- aspect-based-sentiment-analysis-uzbek.py +12 -10
- dataset/uzabsa_all.xml → data/absa_uz_all.xml +0 -0
- requirements.txt +2 -0
.gitignore
ADDED
@@ -0,0 +1,117 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Created by https://www.toptal.com/developers/gitignore/api/pycharm
|
2 |
+
# Edit at https://www.toptal.com/developers/gitignore?templates=pycharm
|
3 |
+
|
4 |
+
### PyCharm ###
|
5 |
+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
|
6 |
+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
|
7 |
+
|
8 |
+
# User-specific stuff
|
9 |
+
.idea/**/workspace.xml
|
10 |
+
.idea/**/tasks.xml
|
11 |
+
.idea/**/usage.statistics.xml
|
12 |
+
.idea/**/dictionaries
|
13 |
+
.idea/**/shelf
|
14 |
+
|
15 |
+
# AWS User-specific
|
16 |
+
.idea/**/aws.xml
|
17 |
+
|
18 |
+
# Generated files
|
19 |
+
.idea/**/contentModel.xml
|
20 |
+
|
21 |
+
# Sensitive or high-churn files
|
22 |
+
.idea/**/dataSources/
|
23 |
+
.idea/**/dataSources.ids
|
24 |
+
.idea/**/dataSources.local.xml
|
25 |
+
.idea/**/sqlDataSources.xml
|
26 |
+
.idea/**/dynamic.xml
|
27 |
+
.idea/**/uiDesigner.xml
|
28 |
+
.idea/**/dbnavigator.xml
|
29 |
+
|
30 |
+
# Gradle
|
31 |
+
.idea/**/gradle.xml
|
32 |
+
.idea/**/libraries
|
33 |
+
|
34 |
+
# Gradle and Maven with auto-import
|
35 |
+
# When using Gradle or Maven with auto-import, you should exclude module files,
|
36 |
+
# since they will be recreated, and may cause churn. Uncomment if using
|
37 |
+
# auto-import.
|
38 |
+
# .idea/artifacts
|
39 |
+
# .idea/compiler.xml
|
40 |
+
# .idea/jarRepositories.xml
|
41 |
+
# .idea/modules.xml
|
42 |
+
# .idea/*.iml
|
43 |
+
# .idea/modules
|
44 |
+
# *.iml
|
45 |
+
# *.ipr
|
46 |
+
|
47 |
+
# CMake
|
48 |
+
cmake-build-*/
|
49 |
+
|
50 |
+
# Mongo Explorer plugin
|
51 |
+
.idea/**/mongoSettings.xml
|
52 |
+
|
53 |
+
# File-based project format
|
54 |
+
*.iws
|
55 |
+
|
56 |
+
# IntelliJ
|
57 |
+
out/
|
58 |
+
|
59 |
+
# mpeltonen/sbt-idea plugin
|
60 |
+
.idea_modules/
|
61 |
+
|
62 |
+
# JIRA plugin
|
63 |
+
atlassian-ide-plugin.xml
|
64 |
+
|
65 |
+
# Cursive Clojure plugin
|
66 |
+
.idea/replstate.xml
|
67 |
+
|
68 |
+
# SonarLint plugin
|
69 |
+
.idea/sonarlint/
|
70 |
+
|
71 |
+
# Crashlytics plugin (for Android Studio and IntelliJ)
|
72 |
+
com_crashlytics_export_strings.xml
|
73 |
+
crashlytics.properties
|
74 |
+
crashlytics-build.properties
|
75 |
+
fabric.properties
|
76 |
+
|
77 |
+
# Editor-based Rest Client
|
78 |
+
.idea/httpRequests
|
79 |
+
|
80 |
+
# Android studio 3.1+ serialized cache file
|
81 |
+
.idea/caches/build_file_checksums.ser
|
82 |
+
|
83 |
+
### PyCharm Patch ###
|
84 |
+
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
|
85 |
+
|
86 |
+
# *.iml
|
87 |
+
# modules.xml
|
88 |
+
# .idea/misc.xml
|
89 |
+
# *.ipr
|
90 |
+
|
91 |
+
# Sonarlint plugin
|
92 |
+
# https://plugins.jetbrains.com/plugin/7973-sonarlint
|
93 |
+
.idea/**/sonarlint/
|
94 |
+
|
95 |
+
# SonarQube Plugin
|
96 |
+
# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin
|
97 |
+
.idea/**/sonarIssues.xml
|
98 |
+
|
99 |
+
# Markdown Navigator plugin
|
100 |
+
# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced
|
101 |
+
.idea/**/markdown-navigator.xml
|
102 |
+
.idea/**/markdown-navigator-enh.xml
|
103 |
+
.idea/**/markdown-navigator/
|
104 |
+
|
105 |
+
# Cache file creation bug
|
106 |
+
# See https://youtrack.jetbrains.com/issue/JBR-2257
|
107 |
+
.idea/$CACHE_FILE$
|
108 |
+
|
109 |
+
# CodeStream plugin
|
110 |
+
# https://plugins.jetbrains.com/plugin/12206-codestream
|
111 |
+
.idea/codestream.xml
|
112 |
+
|
113 |
+
# Azure Toolkit for IntelliJ plugin
|
114 |
+
# https://plugins.jetbrains.com/plugin/8053-azure-toolkit-for-intellij
|
115 |
+
.idea/**/azureSettings.xml
|
116 |
+
|
117 |
+
# End of https://www.toptal.com/developers/gitignore/api/pycharm
|
aspect-based-sentiment-analysis-uzbek.py
CHANGED
@@ -1,20 +1,21 @@
|
|
1 |
import os
|
2 |
import xml.etree.ElementTree as ET
|
3 |
-
from datasets import DatasetBuilder, DatasetInfo, BuilderConfig, Split, SplitGenerator
|
4 |
|
5 |
-
|
|
|
|
|
6 |
def __init__(self, **kwargs):
|
7 |
super(UZABSAConfig, self).__init__(version="1.0.0", **kwargs)
|
8 |
|
9 |
-
class UzABSA(DatasetBuilder):
|
10 |
BUILDER_CONFIG_CLASS = UZABSAConfig
|
11 |
BUILDER_CONFIGS = [
|
12 |
-
UZABSAConfig(name="uzabsa", description="Uzbek ABSA
|
13 |
]
|
14 |
|
15 |
def _info(self):
|
16 |
-
# Define the
|
17 |
-
return DatasetInfo(
|
18 |
features={
|
19 |
"sentence_id": datasets.Value("string"),
|
20 |
"text": datasets.Value("string"),
|
@@ -37,10 +38,10 @@ class UzABSA(DatasetBuilder):
|
|
37 |
|
38 |
def _split_generators(self, dl_manager):
|
39 |
# Use os.path.join to find the XML file path
|
40 |
-
filepath = os.path.join(os.path.dirname(os.path.abspath(__file__)), "/
|
41 |
return [
|
42 |
-
SplitGenerator(
|
43 |
-
name=Split.TRAIN,
|
44 |
gen_kwargs={
|
45 |
"filepath": filepath,
|
46 |
},
|
@@ -80,4 +81,5 @@ class UzABSA(DatasetBuilder):
|
|
80 |
"text": text,
|
81 |
"aspect_terms": aspect_terms,
|
82 |
"aspect_categories": aspect_categories,
|
83 |
-
}
|
|
|
|
1 |
import os
|
2 |
import xml.etree.ElementTree as ET
|
|
|
3 |
|
4 |
+
import datasets
|
5 |
+
|
6 |
+
class UZABSAConfig(datasets.BuilderConfig):
|
7 |
def __init__(self, **kwargs):
|
8 |
super(UZABSAConfig, self).__init__(version="1.0.0", **kwargs)
|
9 |
|
10 |
+
class UzABSA(datasets.DatasetBuilder):
|
11 |
BUILDER_CONFIG_CLASS = UZABSAConfig
|
12 |
BUILDER_CONFIGS = [
|
13 |
+
UZABSAConfig(name="uzabsa", description="Uzbek ABSA data"),
|
14 |
]
|
15 |
|
16 |
def _info(self):
|
17 |
+
# Define the data features
|
18 |
+
return datasets.DatasetInfo(
|
19 |
features={
|
20 |
"sentence_id": datasets.Value("string"),
|
21 |
"text": datasets.Value("string"),
|
|
|
38 |
|
39 |
def _split_generators(self, dl_manager):
|
40 |
# Use os.path.join to find the XML file path
|
41 |
+
filepath = os.path.join(os.path.dirname(os.path.abspath(__file__)), "data/absa_uz_all.xml")
|
42 |
return [
|
43 |
+
datasets.SplitGenerator(
|
44 |
+
name=datasets.Split.TRAIN,
|
45 |
gen_kwargs={
|
46 |
"filepath": filepath,
|
47 |
},
|
|
|
81 |
"text": text,
|
82 |
"aspect_terms": aspect_terms,
|
83 |
"aspect_categories": aspect_categories,
|
84 |
+
}
|
85 |
+
|
dataset/uzabsa_all.xml → data/absa_uz_all.xml
RENAMED
File without changes
|
requirements.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
datasets
|
2 |
+
xmltodict
|