davidheineman
commited on
Commit
·
72131b0
1
Parent(s):
6f6b25e
final docker container
Browse files- README.md +5 -0
- docker-compose.yml +0 -2
- src/constants.py +2 -0
- src/db.py +8 -7
- src/server.py +2 -2
README.md
CHANGED
@@ -72,6 +72,7 @@ To see an example of search, visit:
|
|
72 |
- TODO:
|
73 |
- On UI
|
74 |
- Colors: make the colors resemble the ACL page much closer
|
|
|
75 |
- Smaller line spacing for abstract text
|
76 |
- Add "PDF" button
|
77 |
- Justify the result metadata (Year, venue, etc.) so the content all starts at the same vertical position
|
@@ -81,6 +82,10 @@ To see an example of search, visit:
|
|
81 |
- If the user selects certain venues, remember these venues
|
82 |
- Add a dropdown under the "Workshop" box to select specific workshops
|
83 |
|
|
|
|
|
|
|
|
|
84 |
- Have articles before 2020
|
85 |
|
86 |
- Maybe make the UI more compressed like this: https://aclanthology.org/events/eacl-2024/#2024eacl-long
|
|
|
72 |
- TODO:
|
73 |
- On UI
|
74 |
- Colors: make the colors resemble the ACL page much closer
|
75 |
+
- There's still a bunch of blue from the bootstrap themeing
|
76 |
- Smaller line spacing for abstract text
|
77 |
- Add "PDF" button
|
78 |
- Justify the result metadata (Year, venue, etc.) so the content all starts at the same vertical position
|
|
|
82 |
- If the user selects certain venues, remember these venues
|
83 |
- Add a dropdown under the "Workshop" box to select specific workshops
|
84 |
|
85 |
+
- Include the title in the indexing
|
86 |
+
|
87 |
+
- https://docs.docker.com/language/python/configure-ci-cd/
|
88 |
+
|
89 |
- Have articles before 2020
|
90 |
|
91 |
- Maybe make the UI more compressed like this: https://aclanthology.org/events/eacl-2024/#2024eacl-long
|
docker-compose.yml
CHANGED
@@ -1,5 +1,3 @@
|
|
1 |
-
version: '3.8'
|
2 |
-
|
3 |
services:
|
4 |
mysql:
|
5 |
image: mysql:8.0
|
|
|
|
|
|
|
1 |
services:
|
2 |
mysql:
|
3 |
image: mysql:8.0
|
src/constants.py
CHANGED
@@ -9,5 +9,7 @@ ANTHOLOGY_PATH = os.path.join(INDEX_ROOT, 'anthology.bib')
|
|
9 |
DATASET_PATH = os.path.join(INDEX_ROOT, 'dataset.json')
|
10 |
|
11 |
DB_NAME = 'anthology'
|
|
|
|
|
12 |
|
13 |
VENUES = Literal['workshop', 'journal', 'short', 'demo', 'tutorial', 'industry', 'findings', 'main']
|
|
|
9 |
DATASET_PATH = os.path.join(INDEX_ROOT, 'dataset.json')
|
10 |
|
11 |
DB_NAME = 'anthology'
|
12 |
+
DB_HOSTNAME = 'mysql_db' # localhost
|
13 |
+
DB_PORT = 3306 # None
|
14 |
|
15 |
VENUES = Literal['workshop', 'journal', 'short', 'demo', 'tutorial', 'industry', 'findings', 'main']
|
src/db.py
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
-
from typing import List, Literal, Optional, Union
|
2 |
-
import mysql.connector
|
3 |
import json
|
|
|
4 |
|
5 |
-
|
|
|
6 |
|
7 |
PAPER_QUERY = """
|
8 |
SELECT *
|
@@ -20,10 +20,10 @@ def read_dataset():
|
|
20 |
|
21 |
def create_database():
|
22 |
db = mysql.connector.connect(
|
23 |
-
host =
|
24 |
user = "root",
|
25 |
password = "",
|
26 |
-
port =
|
27 |
)
|
28 |
cursor = db.cursor()
|
29 |
|
@@ -124,10 +124,11 @@ def query_paper_metadata(
|
|
124 |
if not isinstance(venue_type, list): venue_type = [venue_type]
|
125 |
|
126 |
db = mysql.connector.connect(
|
127 |
-
host =
|
128 |
user = "root",
|
129 |
password = "",
|
130 |
-
database = DB_NAME
|
|
|
131 |
)
|
132 |
|
133 |
cursor = db.cursor()
|
|
|
|
|
|
|
1 |
import json
|
2 |
+
from typing import List, Optional, Union
|
3 |
|
4 |
+
import mysql.connector
|
5 |
+
from constants import DATASET_PATH, DB_HOSTNAME, DB_NAME, DB_PORT, VENUES
|
6 |
|
7 |
PAPER_QUERY = """
|
8 |
SELECT *
|
|
|
20 |
|
21 |
def create_database():
|
22 |
db = mysql.connector.connect(
|
23 |
+
host = DB_HOSTNAME,
|
24 |
user = "root",
|
25 |
password = "",
|
26 |
+
port = DB_PORT
|
27 |
)
|
28 |
cursor = db.cursor()
|
29 |
|
|
|
124 |
if not isinstance(venue_type, list): venue_type = [venue_type]
|
125 |
|
126 |
db = mysql.connector.connect(
|
127 |
+
host = DB_HOSTNAME,
|
128 |
user = "root",
|
129 |
password = "",
|
130 |
+
database = DB_NAME,
|
131 |
+
port = DB_PORT
|
132 |
)
|
133 |
|
134 |
cursor = db.cursor()
|
src/server.py
CHANGED
@@ -101,6 +101,6 @@ if __name__ == "__main__":
|
|
101 |
http://localhost:8893/api/colbert?query=Information retrevial with BERT
|
102 |
http://localhost:8893/api/search?query=Information retrevial with BERT
|
103 |
"""
|
104 |
-
|
105 |
init_colbert(index_path=INDEX_PATH)
|
106 |
-
app.run("0.0.0.0", PORT
|
|
|
101 |
http://localhost:8893/api/colbert?query=Information retrevial with BERT
|
102 |
http://localhost:8893/api/search?query=Information retrevial with BERT
|
103 |
"""
|
104 |
+
create_database()
|
105 |
init_colbert(index_path=INDEX_PATH)
|
106 |
+
app.run("0.0.0.0", PORT) # debug=True
|