Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v2.4.4 #2

Merged
merged 11 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.tflite filter=lfs diff=lfs merge=lfs -text
28 changes: 19 additions & 9 deletions README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
- **Data security**:🔒 Keep your diary safe with a password.
- **Export and share**:🧾 Support all data import/export, as well as single diary sharing.
- **Cloud synchronization**:☁ Support for synchronizing diaries across multiple devices (coming soon).
- **AI assistant**:🤖 Support ability to access large model provides AI (currently support: [Tencent Hunyuan](https://hunyuan.tencent.com/)).
- **Natural Language Processing (NLP)**:🤖 Let your diary more understand you.

(Note: Cross-platform capabilities are provided by Flutter, platforms with * may require more testing)

## 🔧 Technology stack
## 🔧 Main Technology stack

- [Flutter](https://github.com/flutter/flutter)
- [Isar](https://github.com/isar/isar)
Expand All @@ -47,10 +47,6 @@ Some capabilities need to apply for third-party SDKS, and the following service

- [QWeather](https://dev.qweather.com/docs/api/)

#### AI large model

- [Tencent Hunyuan](https://cloud.tencent.com/product/hunyuan)

### Direct mounting

Use it by downloading the compiled installation package in Release, or manually compiling it if you don't have the platform you need.
Expand All @@ -59,7 +55,7 @@ Use it by downloading the compiled installation package in Release, or manually

#### Environmental requirement

- Flutter SDK (>= 3.26.0-0.1.pre)
- Flutter SDK (>= 3.26.0-0.1.pre, Because I use features that have not been incorporated into the stable version, I can only use the beta version and will migrate as soon as the stable version is updated)
- Dart (>= 3.6.0)
- Compatible ides (e.g. Android Studio, Visual Studio Code)

Expand Down Expand Up @@ -92,9 +88,23 @@ Use it by downloading the compiled installation package in Release, or manually
- iOS: `flutter build ios`
- Windows: `flutter build windows`

## 📝 Instructions for use
## 📝 More description

### Natural Language Processing (NLP)

Today, more and more industry products are beginning to incorporate AI technology, which undoubtedly greatly improves our experience. However, for diary applications, it is not acceptable to hand over the data to a large model because it is not certain that the data will be used for training. Therefore, a better approach is to adopt a local model. Although local models may not be as powerful as large models due to size limitations, they can still provide necessary help to a certain extent.

So far, I have integrated the following tasks:

#### SQuAD task based on Bert pre-trained model

I used MobileBert for the SQuAD task, which is a simple machine reading comprehension task. You can ask it questions and it will return the answers you need. The model file is in the '.tflite 'format required by TensorFlow Lite, and the size of the model is about 50MB after quantization.

Thanks to the following open source projects:

Once the installation is complete, you can start creating diary entries by clicking the "New Diary" button. Use a rich text editor to format your content, add multimedia attachments, and organize through tags.
- [Chinese MobileBERT](https://github.com/ymcui/Chinese-MobileBERT)
- [Mobilebert](https://github.com/google-research/google-research/tree/master/mobilebert)
- [ChineseSquad](https://github.com/junzeng-pluto/ChineseSquad)

## 🤝 Contribution guide

Expand Down
28 changes: 19 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
- **数据安全**:🔒 通过密码来保障你的日记安全。
- **导出和分享**:🧾 支持所有数据的导入/导出,以及单篇日记的分享。
- **云同步**:☁ 支持在多个设备间同步日记(即将支持)。
- **AI 助手**:🤖 支持接入大模型提供 AI 能力(目前支持:[腾讯混元](https://hunyuan.tencent.com/))
- **自然语言处理(NLP)**:🤖 让你的日记更懂你

(注:跨平台能力由 Flutter 提供,带 * 号的平台可能需要更多测试)

## 🔧 技术栈
## 🔧 主要技术栈

- [Flutter](https://github.com/flutter/flutter)
- [Isar](https://github.com/isar/isar)
Expand All @@ -47,10 +47,6 @@

- [和风天气](https://dev.qweather.com/docs/api/)

#### AI 大模型

- [腾讯混元大模型](https://cloud.tencent.com/product/hunyuan)

### 直接安装

通过下载 Release 中已编译好的安装包来使用,如果没有你所需要的平台,请使用手动编译。
Expand All @@ -59,7 +55,7 @@

#### 环境要求

- Flutter SDK (>= 3.26.0-0.1.pre)
- Flutter SDK (>= 3.26.0-0.1.pre,因为使用了尚未合并到稳定版的功能,我只能使用测试版,等稳定版更新后会尽快迁移)
- Dart (>= 3.6.0)
- 兼容的 IDE(如 Android Studio、Visual Studio Code)

Expand Down Expand Up @@ -92,9 +88,23 @@
- iOS: `flutter build ios`
- Windows: `flutter build windows`

## 📝 使用说明
## 📝 更多说明

### 自然语言处理(NLP)

如今,越来越多的行业产品开始融入 AI 技术,这无疑极大地提升了我们的使用体验。然而,对于日记应用来说,将数据交给大型模型处理并不可接受,因为无法确定这些数据是否会被用于训练。因此,更好的方法是采用本地模型。虽然由于体积限制,本地模型的能力可能不如大型模型强大,但在一定程度上仍能为我们提供必要的帮助。

目前,我已经集成了以下任务:

#### 基于 Bert 预训练模型的 SQuAD 任务

我采用了 MobileBert 来处理 SQuAD 任务,这是一个简单的机器阅读理解任务。你可以向它提出问题,它会返回你需要的答案。模型文件采用 TensorFlow Lite 所需的 `.tflite` 格式,经过量化后模型大小约为 50MB。

感谢以下开源项目:

安装完成后,你可以通过点击“新建日记”按钮开始创建日记条目。使用富文本编辑器来格式化你的内容,添加多媒体附件,并通过标签进行组织。
- [Chinese MobileBERT](https://github.com/ymcui/Chinese-MobileBERT)
- [Mobilebert](https://github.com/google-research/google-research/tree/master/mobilebert)
- [ChineseSquad](https://github.com/junzeng-pluto/ChineseSquad)

## 🤝 贡献指南

Expand Down
3 changes: 3 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ linter:
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
prefer_const_constructors: true
prefer_const_literals_to_create_immutables: true
prefer_const_declarations: true
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule

Expand Down
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ android {
applicationId = "cn.yooss.moodiary"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdk = 24
minSdk = 26
targetSdk = 35
versionCode = flutterVersionCode.toInteger()
versionName = flutterVersionName
Expand Down
4 changes: 3 additions & 1 deletion android/app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@
-keep class com.hihonor.ads.** {*; }
-keep interface com.hihonor.ads.** {*; }
-keep class repeackage.com.qiku.id.** { *; }
-keep interface repeackage.com.qiku.id.** { *; }
-keep interface repeackage.com.qiku.id.** { *; }
-keep class org.tensorflow.lite.** { *; }
-dontwarn org.tensorflow.lite.**
Loading