farwew commited on
Commit
30bc313
·
verified ·
1 Parent(s): 2c5a72c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -11
app.py CHANGED
@@ -1,20 +1,14 @@
1
  import os
2
  import tarfile
3
- import gdown
4
  import spacy
5
  import gradio as gr
6
 
7
- # URL dan path file model
8
- drive_url = "https://drive.google.com/uc?id=1bOJ3fN9UeOKVam8SHYxDUDpb7ihNph1L"
9
- tar_file = "xx_cv_parsing_ner.tar.gz"
10
  extract_path = "xx_cv_parsing_ner"
11
 
12
- # Cek apakah sudah diekstrak
13
  if not os.path.exists(extract_path):
14
- print("Mengunduh model...")
15
- gdown.download(drive_url, tar_file, quiet=False)
16
-
17
- print("Mengekstrak model...")
18
  with tarfile.open(tar_file, "r:gz") as tar:
19
  tar.extractall(path=extract_path)
20
 
@@ -34,9 +28,8 @@ demo = gr.Interface(
34
  fn=extract_entities,
35
  inputs=gr.Textbox(lines=15, label="Masukkan Teks CV"),
36
  outputs=gr.Dataframe(headers=["Entity", "Label"], label="Hasil Ekstraksi"),
37
- title="Ekstraksi Entitas CV",
38
  )
39
 
40
- # Jalankan
41
  if __name__ == "__main__":
42
  demo.launch()
 
1
  import os
2
  import tarfile
 
3
  import spacy
4
  import gradio as gr
5
 
6
+ # Nama file dan lokasi ekstraksi
7
+ tar_file = "xx_cv_parsing_ner-0.0.1.tar.gz"
 
8
  extract_path = "xx_cv_parsing_ner"
9
 
10
+ # Ekstrak jika belum diekstrak
11
  if not os.path.exists(extract_path):
 
 
 
 
12
  with tarfile.open(tar_file, "r:gz") as tar:
13
  tar.extractall(path=extract_path)
14
 
 
28
  fn=extract_entities,
29
  inputs=gr.Textbox(lines=15, label="Masukkan Teks CV"),
30
  outputs=gr.Dataframe(headers=["Entity", "Label"], label="Hasil Ekstraksi"),
31
+ title="Ekstraksi Entitas CV"
32
  )
33
 
 
34
  if __name__ == "__main__":
35
  demo.launch()