Skip to content

Commit

Permalink
add: subdir bnltk
Browse files Browse the repository at this point in the history
  • Loading branch information
asraf-patoary committed Oct 30, 2024
1 parent 2034634 commit ab49b29
Show file tree
Hide file tree
Showing 28 changed files with 16 additions and 16 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.DS_Store
__pycache__
myenv
myenv
bnltk.egg-info
build
dist
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ print(bn_stemmer.stem('হেসেছিলেন'))
To use the Parts of Speech Tagger, please download the pretrained model's weights. Our trained model achieves an accuracy of 96%
```
from bnltk.bnltk_downloads import DataFiles
DataFiles().download()
DataFiles.download()
```
After successfully downloading the files, you can use this module as follows:

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@


class DataFiles:
def __init__(self):
pass

def downloader(self, url, file_name, tag):
@staticmethod
def _downloader(url, file_name, tag):
if not os.path.exists(file_name):
with open(file_name, "wb") as file:
print("Downloading....../" + tag)
Expand All @@ -34,14 +32,13 @@ def downloader(self, url, file_name, tag):
sys.stdout.flush()
else:
print(tag + "is already exists!!")

def download(self):

@staticmethod
def download():
file_name = None
tag1 = "bn_tagged_mod.txt"
tag2 = "pos_tagger.weights.h5"

print("platform.system() ", platform.system())

if platform.system() == "Windows":
file_name = "C:\\Users\\" + getpass.getuser()
elif platform.system() == "Linux":
Expand All @@ -59,12 +56,12 @@ def download(self):
except OSError:
print("Creation of the directory failed or exists")

self.downloader(
DataFiles._downloader(
corpus_url, file_name + "/bnltk_data/pos_data/bn_tagged_mod.txt", tag1
)
self.downloader(
DataFiles._downloader(
saved_weights_url,
file_name + "/bnltk_data/pos_data/pos_tagger.weights.h5",
tag2,
)
print("Done!")
print("Done!")
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ <h3 class="block-title">Parts of Speech Tagger</h3>
<div class="code-block">
<h6>Default code example:</h6>
<div class="shadow m-5 cm">
<pre><code class="language-py">from bnltk.bnltk_downloads import DataFiles </code> <br><code class="language-py">DataFiles().download() </code> <br></pre>
<pre><code class="language-py">from bnltk.bnltk_downloads import DataFiles </code> <br><code class="language-py">DataFiles.download() </code> <br></pre>
</div>

</div>
Expand Down
Binary file removed pos_tagger/.DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[pytest]
testpaths = tests
testpaths = bnltk/tests
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@
"Operating System :: OS Independent",
],
python_requires=">=3.6",
include_package_data=True,
include_package_data=True
)
Binary file removed stemmer/.DS_Store
Binary file not shown.
Binary file removed stemmer/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file removed stemmer/__pycache__/stemmer_builder.cpython-36.pyc
Binary file not shown.
Binary file not shown.
Binary file removed tokenize/.DS_Store
Binary file not shown.

0 comments on commit ab49b29

Please sign in to comment.