Skip to content

Commit

Permalink
feat: add nlp
Browse files Browse the repository at this point in the history
  • Loading branch information
jincheng.zhang committed Apr 30, 2024
1 parent 04c14b3 commit 0f781ab
Show file tree
Hide file tree
Showing 8 changed files with 284 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ permissions:

jobs:
build-and-upload:
env:
RUST_TOOLCHAIN: nightly
name: Build and upload
runs-on: ${{ matrix.os }}

Expand Down
156 changes: 155 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ eframe = { version = "0.27.0", default-features = false, features = [
"default_fonts", # Embed the default egui fonts.
"glow", # Use the glow rendering backend. Alternative: "wgpu".
] }

futures-util = "0.3.29"
rayon = "1.10.0"
prettify-js = "=0.1.0"
15 changes: 15 additions & 0 deletions crates/netpurr/prompt/js.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ map:
assert:
fill: assert(<expect>,<actual>)
desc: assert
assert_nlp:
fill: assert_nlp(<expect>,<actual>,0.7)
desc: assert nlp
JSON:
fill: JSON
desc: JSON
Expand All @@ -80,3 +83,15 @@ map:
JSON.stringify:
fill: JSON.stringify(<value>)
desc: JSON.stringify
nlp.keywords:
fill: nlp.keywords(<value>,key_count)
desc: get keywords
nlp.tags:
fill: nlp.tags(<value>)
desc: get tags
nlp.tag_filter:
fill: nlp.tag_filter(<value>,<[tags]>)
desc: get tags with filter
nlp.similarity:
fill: nlp.similarity(<value>,<value>)
desc: similarity
2 changes: 1 addition & 1 deletion crates/netpurr_core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ version.workspace = true
[dependencies]
reqwest_cookie_store = { path = "./../reqwest_cookie_store" }
cookie_store = { path = "./../cookie_store" }

jieba-rs = { version = "0.7", features = ["tfidf", "textrank"] }
serde.workspace = true
serde_json.workspace = true
serde_yaml.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/netpurr_core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ pub mod runner;
pub mod script;
pub mod utils;

pub const APP_NAME: &str = "Netpurr";
pub const APP_NAME: &str = "Netpurr";
Loading

0 comments on commit 0f781ab

Please sign in to comment.