Spaces:
Build error
Build error
freemt
commited on
Commit
·
52771bf
1
Parent(s):
3d38118
Update swap columns in df_aigned
Browse files- radiobee/__main__.py +5 -0
- radiobee/gen_aset.py +1 -1
- radiobee/gen_pset.py +2 -1
radiobee/__main__.py
CHANGED
@@ -322,6 +322,10 @@ if __name__ == "__main__":
|
|
322 |
# df_aligned = df_trimmed
|
323 |
df_aligned = pd.DataFrame(final_list, columns=["text1", "text2", "likelihood"])
|
324 |
|
|
|
|
|
|
|
|
|
325 |
_ = df_aligned.to_csv(index=False)
|
326 |
file_dl = Path(f"{Path(file1.name).stem[:-8]}-{Path(file2.name).stem[:-8]}.csv")
|
327 |
file_dl.write_text(_, encoding="utf8")
|
@@ -349,6 +353,7 @@ if __name__ == "__main__":
|
|
349 |
article = dedent(
|
350 |
"""
|
351 |
## NB
|
|
|
352 |
* Click "Clear" first for subsequent submits when uploading files.
|
353 |
* `tf_type` `idf_type` `dl_type` `norm`: Normally there is no need to touch these unless you know what you are doing.
|
354 |
* Suggested `esp` and `min_samples` values -- `esp` (minimum epsilon): 8-12, `min_samples`: 4-8.
|
|
|
322 |
# df_aligned = df_trimmed
|
323 |
df_aligned = pd.DataFrame(final_list, columns=["text1", "text2", "likelihood"])
|
324 |
|
325 |
+
# swap text1 text2
|
326 |
+
df_aligned = df_aligned[["text2", "text1", "likelihood"]]
|
327 |
+
df_aligned.columns = ["text1", "text2", "likelihood"]
|
328 |
+
|
329 |
_ = df_aligned.to_csv(index=False)
|
330 |
file_dl = Path(f"{Path(file1.name).stem[:-8]}-{Path(file2.name).stem[:-8]}.csv")
|
331 |
file_dl.write_text(_, encoding="utf8")
|
|
|
353 |
article = dedent(
|
354 |
"""
|
355 |
## NB
|
356 |
+
* `radiobee aligner` is a sibling of `bumblebee aligner`. To know more about these aligners, please join qq group `316287378`.
|
357 |
* Click "Clear" first for subsequent submits when uploading files.
|
358 |
* `tf_type` `idf_type` `dl_type` `norm`: Normally there is no need to touch these unless you know what you are doing.
|
359 |
* Suggested `esp` and `min_samples` values -- `esp` (minimum epsilon): 8-12, `min_samples`: 4-8.
|
radiobee/gen_aset.py
CHANGED
@@ -7,7 +7,7 @@ from itertools import zip_longest
|
|
7 |
|
8 |
# fmt: off
|
9 |
def gen_aset(
|
10 |
-
pset: List[Tuple[
|
11 |
src_len: int, # n_rows
|
12 |
tgt_len: int, # n_cols
|
13 |
) -> List[Tuple[Union[str, float], Union[str, float], Union[str, float]]]:
|
|
|
7 |
|
8 |
# fmt: off
|
9 |
def gen_aset(
|
10 |
+
pset: List[Tuple[Union[str, float], Union[str, float], Union[str, float]]],
|
11 |
src_len: int, # n_rows
|
12 |
tgt_len: int, # n_cols
|
13 |
) -> List[Tuple[Union[str, float], Union[str, float], Union[str, float]]]:
|
radiobee/gen_pset.py
CHANGED
@@ -19,7 +19,8 @@ def gen_pset(
|
|
19 |
min_samples: int = 6,
|
20 |
delta: float = 7,
|
21 |
verbose: Union[bool, int] = False,
|
22 |
-
) -> List[Tuple[int, int, Union[float, str]]]:
|
|
|
23 |
"""Gen pset from cmat.
|
24 |
Find pairs for a given cmat.
|
25 |
|
|
|
19 |
min_samples: int = 6,
|
20 |
delta: float = 7,
|
21 |
verbose: Union[bool, int] = False,
|
22 |
+
# ) -> List[Tuple[int, int, Union[float, str]]]:
|
23 |
+
) -> List[Tuple[Union[float, str], Union[float, str], Union[float, str]]]:
|
24 |
"""Gen pset from cmat.
|
25 |
Find pairs for a given cmat.
|
26 |
|