Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
LAE
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
文靖昊
LAE
Commits
130b6514
Commit
130b6514
authored
a year ago
by
文靖昊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
拼接json串时使用from_file替代filename
parent
e0c67685
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
get_similarity.py
src/server/get_similarity.py
+2
-2
No files found.
src/server/get_similarity.py
View file @
130b6514
...
@@ -64,7 +64,7 @@ class GetSimilarityWithExt:
...
@@ -64,7 +64,7 @@ class GetSimilarityWithExt:
hash_str
=
""
hash_str
=
""
if
"hash"
in
d1
.
metadata
:
if
"hash"
in
d1
.
metadata
:
hash_str
=
d1
.
metadata
[
"hash"
]
hash_str
=
d1
.
metadata
[
"hash"
]
result
+=
(
"{
\"
page_content
\"
:
\"
"
+
d1
.
page_content
+
"
\"
,
\"
f
ilenam
e
\"
:
\"
"
+
d1
.
metadata
[
"filename"
]
+
"
\"
,
\"
hash
\"
:
\"
"
+
hash_str
+
"
\"
,
\"
page_number
\"
:
\"
"
+
page_number
+
"
\"
}"
)
result
+=
(
"{
\"
page_content
\"
:
\"
"
+
d1
.
page_content
+
"
\"
,
\"
f
rom_fil
e
\"
:
\"
"
+
d1
.
metadata
[
"filename"
]
+
"
\"
,
\"
hash
\"
:
\"
"
+
hash_str
+
"
\"
,
\"
page_number
\"
:
\"
"
+
page_number
+
"
\"
}"
)
docs
=
docs
[
1
:]
docs
=
docs
[
1
:]
for
doc
in
docs
:
for
doc
in
docs
:
page_number
=
"0"
page_number
=
"0"
...
@@ -73,7 +73,7 @@ class GetSimilarityWithExt:
...
@@ -73,7 +73,7 @@ class GetSimilarityWithExt:
hash_str
=
""
hash_str
=
""
if
"hash"
in
doc
.
metadata
:
if
"hash"
in
doc
.
metadata
:
hash_str
=
doc
.
metadata
[
"hash"
]
hash_str
=
doc
.
metadata
[
"hash"
]
result
+=
(
",{
\"
page_content
\"
:
\"
"
+
doc
.
page_content
+
"
\"
,
\"
f
ilenam
e
\"
:
\"
"
+
doc
.
metadata
[
"filename"
]
+
"
\"
,
\"
hash
\"
:
\"
"
+
hash_str
+
"
\"
,
\"
page_number
\"
:
\"
"
+
page_number
+
"
\"
}"
)
result
+=
(
",{
\"
page_content
\"
:
\"
"
+
doc
.
page_content
+
"
\"
,
\"
f
rom_fil
e
\"
:
\"
"
+
doc
.
metadata
[
"filename"
]
+
"
\"
,
\"
hash
\"
:
\"
"
+
hash_str
+
"
\"
,
\"
page_number
\"
:
\"
"
+
page_number
+
"
\"
}"
)
result
+=
"]"
result
+=
"]"
return
result
return
result
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment